summaryrefslogtreecommitdiffstats
path: root/third_party/rust/ash/tests/constant_size_arrays.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/ash/tests/constant_size_arrays.rs')
-rw-r--r--third_party/rust/ash/tests/constant_size_arrays.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/third_party/rust/ash/tests/constant_size_arrays.rs b/third_party/rust/ash/tests/constant_size_arrays.rs
new file mode 100644
index 0000000000..a756f34ac2
--- /dev/null
+++ b/third_party/rust/ash/tests/constant_size_arrays.rs
@@ -0,0 +1,33 @@
+use ash::vk::{PhysicalDeviceProperties, PipelineColorBlendStateCreateInfo};
+
+#[test]
+fn assert_struct_field_is_array() {
+ let pipeline_cache_uuid: [u8; 16] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+
+ let _ = PhysicalDeviceProperties::builder().pipeline_cache_uuid(pipeline_cache_uuid);
+
+ let _ = PhysicalDeviceProperties {
+ pipeline_cache_uuid,
+ ..Default::default()
+ };
+
+ let blend_constants: [f32; 4] = [0.0, 0.0, 0.0, 0.0];
+
+ let _ = PipelineColorBlendStateCreateInfo::builder().blend_constants(blend_constants);
+
+ let _ = PipelineColorBlendStateCreateInfo {
+ blend_constants,
+ ..Default::default()
+ };
+}
+
+#[test]
+#[allow(dead_code)]
+fn assert_ffi_array_param_is_pointer() {
+ // don't run it, just make sure it compiles
+ unsafe fn dummy(device: &ash::Device, cmd_buffer: ash::vk::CommandBuffer) {
+ let blend_constants: [f32; 4] = [0.0, 0.0, 0.0, 0.0];
+
+ device.cmd_set_blend_constants(cmd_buffer, &blend_constants);
+ }
+}