// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Auto generated from pyronyx-gen — generated extensions
// Do not Edit! Execute `cargo run pyronyx-gen`
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

use crate::vk::*;
use core::ffi::CStr;

/// Type: `Device`
pub const NAME: &CStr = c"VK_QCOM_tile_shading";
pub const SPEC_VERSION: u32 = 2;

pub trait TileShadingCommandBuffer {
    fn dispatch_tile(&self, dispatch_tile_info: &DispatchTileInfoQCOM);

    fn begin_per_tile_execution(&self, per_tile_begin_info: &PerTileBeginInfoQCOM);

    fn end_per_tile_execution(&self, per_tile_end_info: &PerTileEndInfoQCOM);
}

impl TileShadingCommandBuffer for CommandBuffer {
    /// <https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdDispatchTileQCOM.html>
    ///
    /// Affected by Conditional Rendering.
    /// Queues types: `Compute`.
    /// Task: `Executes GPU work`.
    /// Use inside `RenderPass`.
    /// Command buffer level: `primary`, `secondary`.
    #[inline]
    fn dispatch_tile(&self, dispatch_tile_info: &DispatchTileInfoQCOM) {
        let call = self
            .fns()
            .qcom_tile_shading
            .as_ref()
            .expect(Self::EXT_LOAD_ERROR)
            .dispatch_tile_qcom;

        unsafe { (call)(self.handle, dispatch_tile_info) };
    }

    /// <https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdBeginPerTileExecutionQCOM.html>
    ///
    /// Queues types: `Graphics`, `Compute`.
    /// Task: `Vulkan state access`.
    /// Use inside `RenderPass`.
    /// Command buffer level: `primary`, `secondary`.
    #[inline]
    fn begin_per_tile_execution(&self, per_tile_begin_info: &PerTileBeginInfoQCOM) {
        let call = self
            .fns()
            .qcom_tile_shading
            .as_ref()
            .expect(Self::EXT_LOAD_ERROR)
            .begin_per_tile_execution_qcom;

        unsafe { (call)(self.handle, per_tile_begin_info) };
    }

    /// <https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdEndPerTileExecutionQCOM.html>
    ///
    /// Queues types: `Graphics`, `Compute`.
    /// Task: `Vulkan state access`.
    /// Use inside `RenderPass`.
    /// Command buffer level: `primary`, `secondary`.
    #[inline]
    fn end_per_tile_execution(&self, per_tile_end_info: &PerTileEndInfoQCOM) {
        let call = self
            .fns()
            .qcom_tile_shading
            .as_ref()
            .expect(Self::EXT_LOAD_ERROR)
            .end_per_tile_execution_qcom;

        unsafe { (call)(self.handle, per_tile_end_info) };
    }
}
