Pass constant size arrays by reference

This commit is contained in:
Dzmitry Malyshau 2019-03-08 00:06:01 -05:00
parent c801dea0dc
commit 7aa30a6544
3 changed files with 5 additions and 5 deletions

View file

@ -1132,7 +1132,7 @@ pub trait DeviceV1_0 {
unsafe fn cmd_set_blend_constants(
&self,
command_buffer: vk::CommandBuffer,
blend_constants: [f32; 4],
blend_constants: &[f32; 4],
) {
self.fp_v1_0()
.cmd_set_blend_constants(command_buffer, blend_constants);

View file

@ -2190,7 +2190,7 @@ pub struct DeviceFnV1_0 {
depth_bias_slope_factor: f32,
) -> c_void,
pub cmd_set_blend_constants:
extern "system" fn(command_buffer: CommandBuffer, blend_constants: [f32; 4]) -> c_void,
extern "system" fn(command_buffer: CommandBuffer, blend_constants: &[f32; 4]) -> c_void,
pub cmd_set_depth_bounds: extern "system" fn(
command_buffer: CommandBuffer,
min_depth_bounds: f32,
@ -4058,7 +4058,7 @@ impl DeviceFnV1_0 {
cmd_set_blend_constants: unsafe {
extern "system" fn cmd_set_blend_constants(
_command_buffer: CommandBuffer,
_blend_constants: [f32; 4],
_blend_constants: &[f32; 4],
) -> c_void {
panic!(concat!(
"Unable to load ",
@ -5545,7 +5545,7 @@ impl DeviceFnV1_0 {
pub unsafe fn cmd_set_blend_constants(
&self,
command_buffer: CommandBuffer,
blend_constants: [f32; 4],
blend_constants: &[f32; 4],
) -> c_void {
(self.cmd_set_blend_constants)(command_buffer, blend_constants)
}

View file

@ -663,7 +663,7 @@ impl FieldExt for vkxml::Field {
let size = constant_name(size);
let size = Term::intern(&size);
Some(quote! {
[#ty; #size]
&[#ty; #size]
})
}
_ => None,