/**
 * @file mvgal_vkd3d.h
 * @brief VKD3D-Proton integration bridge header
 *
 * MVGAL - Multi-Vendor GPU Aggregation Layer for Linux
 *
 * SPDX-License-Identifier: MIT
 */

#ifndef MVGAL_VKD3D_H
#define MVGAL_VKD3D_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @brief Ray tracing pipeline statistics
 */
struct VKD3DRayTracingStats {
    uint64_t total_memory_bytes;
    uint32_t shader_groups;
    uint32_t max_pipeline_depth;
};

/**
 * @brief Initialize VKD3D-Proton bridge
 * @return 0 on success, -1 on failure
 */
int vkd3d_bridge_init(void);

/**
 * @brief Get VKD3D-Proton version
 * @return VKD3D version (major * 100 + minor)
 */
uint32_t vkd3d_bridge_get_version(void);

/**
 * @brief Check if VKD3D bridge is available
 * @return Non-zero if available, 0 if not
 */
int vkd3d_bridge_is_available(void);

/**
 * @brief Submit VKD3D command buffer through MVGAL
 * @param cmd_buf Command buffer to submit
 * @param wait_semaphore Wait semaphore
 * @param signal_semaphore Signal semaphore
 * @return 0 on success, -1 on failure
 */
int vkd3d_bridge_submit_command_buffer(
    void *cmd_buf,
    uint64_t wait_semaphore,
    uint64_t signal_semaphore
);

/**
 * @brief Get ray tracing pipeline statistics
 * @param pipeline Pipeline handle
 * @param stats Output statistics
 * @return 0 on success, -1 on failure
 */
int vkd3d_bridge_get_rt_stats(void *pipeline, struct VKD3DRayTracingStats *stats);

#ifdef __cplusplus
}
#endif

#endif /* MVGAL_VKD3D_H */