1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# ! [ doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_AMD_shader_info.html)" ]#[doc = "<s>Vulkan Manual Page</s> · Constant"]
pub const AMD_SHADER_INFO_SPEC_VERSION: u32 = 1;
#[doc = "<s>Vulkan Manual Page</s> · Constant"]
pub const AMD_SHADER_INFO_EXTENSION_NAME: *const std::os::raw::c_char =
    crate::cstr!("VK_AMD_shader_info");
#[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetShaderInfoAMD.html) · Device Command"]
#[allow(non_camel_case_types)]
pub type PFN_vkGetShaderInfoAMD = unsafe extern "system" fn(
    device: crate::vk1_0::Device,
    pipeline: crate::vk1_0::Pipeline,
    shader_stage: crate::vk1_0::ShaderStageFlagBits,
    info_type: crate::extensions::amd_shader_info::ShaderInfoTypeAMD,
    p_info_size: *mut usize,
    p_info: *mut std::ffi::c_void,
) -> crate::vk1_0::Result;
#[doc = "Provides Device Commands for [`AmdShaderInfoDeviceLoaderExt`](trait.AmdShaderInfoDeviceLoaderExt.html)"]
pub struct AmdShaderInfoDeviceCommands {
    pub get_shader_info_amd: PFN_vkGetShaderInfoAMD,
}
impl AmdShaderInfoDeviceCommands {
    #[inline]
    pub fn load(loader: &crate::DeviceLoader) -> Option<AmdShaderInfoDeviceCommands> {
        unsafe {
            Some(AmdShaderInfoDeviceCommands {
                get_shader_info_amd: std::mem::transmute(loader.symbol("vkGetShaderInfoAMD")?),
            })
        }
    }
}
#[doc = "Provides high level command wrappers for [`AmdShaderInfoDeviceCommands`](struct.AmdShaderInfoDeviceCommands.html)"]
pub trait AmdShaderInfoDeviceLoaderExt {
    #[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetShaderInfoAMD.html) · Device Command"]
    unsafe fn get_shader_info_amd(
        &self,
        pipeline: crate::vk1_0::Pipeline,
        shader_stage: crate::vk1_0::ShaderStageFlagBits,
        info_type: crate::extensions::amd_shader_info::ShaderInfoTypeAMD,
        info_size: *mut usize,
        info: *mut std::ffi::c_void,
    ) -> crate::utils::VulkanResult<()>;
}
impl AmdShaderInfoDeviceLoaderExt for crate::DeviceLoader {
    #[inline]
    #[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetShaderInfoAMD.html) · Device Command"]
    unsafe fn get_shader_info_amd(
        &self,
        pipeline: crate::vk1_0::Pipeline,
        shader_stage: crate::vk1_0::ShaderStageFlagBits,
        info_type: crate::extensions::amd_shader_info::ShaderInfoTypeAMD,
        info_size: *mut usize,
        info: *mut std::ffi::c_void,
    ) -> crate::utils::VulkanResult<()> {
        let function = self
            .amd_shader_info
            .as_ref()
            .expect("`amd_shader_info` not loaded")
            .get_shader_info_amd;
        let _val = function(
            self.handle,
            pipeline,
            shader_stage,
            info_type,
            info_size,
            info,
        );
        crate::utils::VulkanResult::new(_val, ())
    }
}
#[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderInfoTypeAMD.html) · Enum"]
#[derive(Copy, Clone, PartialEq, Eq, Hash, Default)]
#[repr(transparent)]
pub struct ShaderInfoTypeAMD(pub i32);
#[doc = "[Part of `extensions::amd_shader_info`](../../extensions/amd_shader_info/index.html)"]
impl ShaderInfoTypeAMD {
    pub const STATISTICS_AMD: Self = Self(0);
    pub const BINARY_AMD: Self = Self(1);
    pub const DISASSEMBLY_AMD: Self = Self(2);
}
impl std::fmt::Debug for ShaderInfoTypeAMD {
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        fmt.write_str(match self {
            &Self::STATISTICS_AMD => "STATISTICS_AMD",
            &Self::BINARY_AMD => "BINARY_AMD",
            &Self::DISASSEMBLY_AMD => "DISASSEMBLY_AMD",
            _ => "(Unknown)",
        })
    }
}
#[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderResourceUsageAMD.html) · Structure"]
#[derive(Copy, Clone)]
#[repr(C)]
pub struct ShaderResourceUsageAMD {
    pub num_used_vgprs: u32,
    pub num_used_sgprs: u32,
    pub lds_size_per_local_work_group: u32,
    pub lds_usage_size_in_bytes: usize,
    pub scratch_mem_usage_in_bytes: usize,
}
impl ShaderResourceUsageAMD {
    #[inline]
    pub fn builder<'a>(self) -> ShaderResourceUsageAMDBuilder<'a> {
        ShaderResourceUsageAMDBuilder(self, std::marker::PhantomData)
    }
}
impl std::fmt::Debug for ShaderResourceUsageAMD {
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        fmt.debug_struct("ShaderResourceUsageAMD")
            .field("num_used_vgprs", &self.num_used_vgprs)
            .field("num_used_sgprs", &self.num_used_sgprs)
            .field(
                "lds_size_per_local_work_group",
                &self.lds_size_per_local_work_group,
            )
            .field("lds_usage_size_in_bytes", &self.lds_usage_size_in_bytes)
            .field(
                "scratch_mem_usage_in_bytes",
                &self.scratch_mem_usage_in_bytes,
            )
            .finish()
    }
}
impl Default for ShaderResourceUsageAMD {
    fn default() -> ShaderResourceUsageAMD {
        ShaderResourceUsageAMD {
            num_used_vgprs: Default::default(),
            num_used_sgprs: Default::default(),
            lds_size_per_local_work_group: Default::default(),
            lds_usage_size_in_bytes: Default::default(),
            scratch_mem_usage_in_bytes: Default::default(),
        }
    }
}
#[derive(Copy, Clone)]
#[doc = "Builder of [`ShaderResourceUsageAMD`](struct.ShaderResourceUsageAMD.html)"]
#[repr(transparent)]
pub struct ShaderResourceUsageAMDBuilder<'a>(
    ShaderResourceUsageAMD,
    std::marker::PhantomData<&'a ()>,
);
impl<'a> ShaderResourceUsageAMDBuilder<'a> {
    #[inline]
    pub fn new() -> ShaderResourceUsageAMDBuilder<'a> {
        ShaderResourceUsageAMDBuilder(Default::default(), std::marker::PhantomData)
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn num_used_vgprs(mut self, num_used_vgprs: u32) -> Self {
        self.0.num_used_vgprs = num_used_vgprs;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn num_used_sgprs(mut self, num_used_sgprs: u32) -> Self {
        self.0.num_used_sgprs = num_used_sgprs;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn lds_size_per_local_work_group(mut self, lds_size_per_local_work_group: u32) -> Self {
        self.0.lds_size_per_local_work_group = lds_size_per_local_work_group;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn lds_usage_size_in_bytes(mut self, lds_usage_size_in_bytes: usize) -> Self {
        self.0.lds_usage_size_in_bytes = lds_usage_size_in_bytes;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn scratch_mem_usage_in_bytes(mut self, scratch_mem_usage_in_bytes: usize) -> Self {
        self.0.scratch_mem_usage_in_bytes = scratch_mem_usage_in_bytes;
        self
    }
    #[inline]
    #[doc = "Discards all lifetime information. Use the `Deref` and `DerefMut` implementations if possible."]
    pub unsafe fn discard(self) -> ShaderResourceUsageAMD {
        self.0
    }
}
impl<'a> std::fmt::Debug for ShaderResourceUsageAMDBuilder<'a> {
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        std::fmt::Debug::fmt(&self.0, fmt)
    }
}
impl<'a> std::ops::Deref for ShaderResourceUsageAMDBuilder<'a> {
    type Target = ShaderResourceUsageAMD;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl<'a> std::ops::DerefMut for ShaderResourceUsageAMDBuilder<'a> {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
#[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderStatisticsInfoAMD.html) · Structure"]
#[derive(Copy, Clone)]
#[repr(C)]
pub struct ShaderStatisticsInfoAMD {
    pub shader_stage_mask: crate::vk1_0::ShaderStageFlags,
    pub resource_usage: crate::extensions::amd_shader_info::ShaderResourceUsageAMD,
    pub num_physical_vgprs: u32,
    pub num_physical_sgprs: u32,
    pub num_available_vgprs: u32,
    pub num_available_sgprs: u32,
    pub compute_work_group_size: [u32; 3],
}
impl ShaderStatisticsInfoAMD {
    #[inline]
    pub fn builder<'a>(self) -> ShaderStatisticsInfoAMDBuilder<'a> {
        ShaderStatisticsInfoAMDBuilder(self, std::marker::PhantomData)
    }
}
impl std::fmt::Debug for ShaderStatisticsInfoAMD {
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        fmt.debug_struct("ShaderStatisticsInfoAMD")
            .field("shader_stage_mask", &self.shader_stage_mask)
            .field("resource_usage", &self.resource_usage)
            .field("num_physical_vgprs", &self.num_physical_vgprs)
            .field("num_physical_sgprs", &self.num_physical_sgprs)
            .field("num_available_vgprs", &self.num_available_vgprs)
            .field("num_available_sgprs", &self.num_available_sgprs)
            .field("compute_work_group_size", &self.compute_work_group_size)
            .finish()
    }
}
impl Default for ShaderStatisticsInfoAMD {
    fn default() -> ShaderStatisticsInfoAMD {
        ShaderStatisticsInfoAMD {
            shader_stage_mask: Default::default(),
            resource_usage: Default::default(),
            num_physical_vgprs: Default::default(),
            num_physical_sgprs: Default::default(),
            num_available_vgprs: Default::default(),
            num_available_sgprs: Default::default(),
            compute_work_group_size: Default::default(),
        }
    }
}
#[derive(Copy, Clone)]
#[doc = "Builder of [`ShaderStatisticsInfoAMD`](struct.ShaderStatisticsInfoAMD.html)"]
#[repr(transparent)]
pub struct ShaderStatisticsInfoAMDBuilder<'a>(
    ShaderStatisticsInfoAMD,
    std::marker::PhantomData<&'a ()>,
);
impl<'a> ShaderStatisticsInfoAMDBuilder<'a> {
    #[inline]
    pub fn new() -> ShaderStatisticsInfoAMDBuilder<'a> {
        ShaderStatisticsInfoAMDBuilder(Default::default(), std::marker::PhantomData)
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn shader_stage_mask(mut self, shader_stage_mask: crate::vk1_0::ShaderStageFlags) -> Self {
        self.0.shader_stage_mask = shader_stage_mask;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn resource_usage(
        mut self,
        resource_usage: crate::extensions::amd_shader_info::ShaderResourceUsageAMD,
    ) -> Self {
        self.0.resource_usage = resource_usage;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn num_physical_vgprs(mut self, num_physical_vgprs: u32) -> Self {
        self.0.num_physical_vgprs = num_physical_vgprs;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn num_physical_sgprs(mut self, num_physical_sgprs: u32) -> Self {
        self.0.num_physical_sgprs = num_physical_sgprs;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn num_available_vgprs(mut self, num_available_vgprs: u32) -> Self {
        self.0.num_available_vgprs = num_available_vgprs;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn num_available_sgprs(mut self, num_available_sgprs: u32) -> Self {
        self.0.num_available_sgprs = num_available_sgprs;
        self
    }
    #[allow(unused_mut)]
    #[inline]
    pub fn compute_work_group_size(mut self, compute_work_group_size: [u32; 3]) -> Self {
        self.0.compute_work_group_size = compute_work_group_size;
        self
    }
    #[inline]
    #[doc = "Discards all lifetime information. Use the `Deref` and `DerefMut` implementations if possible."]
    pub unsafe fn discard(self) -> ShaderStatisticsInfoAMD {
        self.0
    }
}
impl<'a> std::fmt::Debug for ShaderStatisticsInfoAMDBuilder<'a> {
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        std::fmt::Debug::fmt(&self.0, fmt)
    }
}
impl<'a> std::ops::Deref for ShaderStatisticsInfoAMDBuilder<'a> {
    type Target = ShaderStatisticsInfoAMD;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl<'a> std::ops::DerefMut for ShaderStatisticsInfoAMDBuilder<'a> {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}