Skip to content

Commit

Permalink
Pass constant size arrays by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Mar 8, 2019
1 parent c801dea commit 7aa30a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ash/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions ash/src/vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 ",
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7aa30a6

Please sign in to comment.