mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
fmt: fix alignment of struct init fields (#22025)
This commit is contained in:
parent
99da5726db
commit
c51d30bf53
671 changed files with 18817 additions and 18787 deletions
|
@ -80,7 +80,7 @@ fn create_texture(w int, h int, buf byteptr) (gfx.Image, gfx.Sampler) {
|
|||
// vfmt on
|
||||
// comment if .dynamic is enabled
|
||||
img_desc.data.subimage[0][0] = gfx.Range{
|
||||
ptr: buf
|
||||
ptr: buf
|
||||
size: usize(sz)
|
||||
}
|
||||
|
||||
|
@ -89,8 +89,8 @@ fn create_texture(w int, h int, buf byteptr) (gfx.Image, gfx.Sampler) {
|
|||
mut smp_desc := gfx.SamplerDesc{
|
||||
min_filter: .linear
|
||||
mag_filter: .linear
|
||||
wrap_u: .clamp_to_edge
|
||||
wrap_v: .clamp_to_edge
|
||||
wrap_u: .clamp_to_edge
|
||||
wrap_v: .clamp_to_edge
|
||||
}
|
||||
|
||||
sg_smp := gfx.make_sampler(&smp_desc)
|
||||
|
@ -106,7 +106,7 @@ fn update_text_texture(sg_img gfx.Image, w int, h int, buf byteptr) {
|
|||
sz := w * h * 4
|
||||
mut tmp_sbc := gfx.ImageData{}
|
||||
tmp_sbc.subimage[0][0] = gfx.Range{
|
||||
ptr: buf
|
||||
ptr: buf
|
||||
size: usize(sz)
|
||||
}
|
||||
gfx.update_image(sg_img, &tmp_sbc)
|
||||
|
@ -183,7 +183,7 @@ fn init_cube_glsl_i(mut app App) {
|
|||
unsafe { vmemset(&vert_buffer_desc, 0, int(sizeof(vert_buffer_desc))) }
|
||||
vert_buffer_desc.size = usize(vertices.len * int(sizeof(Vertex_t)))
|
||||
vert_buffer_desc.data = gfx.Range{
|
||||
ptr: vertices.data
|
||||
ptr: vertices.data
|
||||
size: usize(vertices.len * int(sizeof(Vertex_t)))
|
||||
}
|
||||
vert_buffer_desc.@type = .vertexbuffer
|
||||
|
@ -218,7 +218,7 @@ fn init_cube_glsl_i(mut app App) {
|
|||
unsafe { vmemset(&index_buffer_desc, 0, int(sizeof(index_buffer_desc))) }
|
||||
index_buffer_desc.size = usize(indices.len * int(sizeof(u16)))
|
||||
index_buffer_desc.data = gfx.Range{
|
||||
ptr: indices.data
|
||||
ptr: indices.data
|
||||
size: usize(indices.len * int(sizeof(u16)))
|
||||
}
|
||||
index_buffer_desc.@type = .indexbuffer
|
||||
|
@ -253,7 +253,7 @@ fn init_cube_glsl_i(mut app App) {
|
|||
|
||||
pipdesc.depth = gfx.DepthState{
|
||||
write_enabled: true
|
||||
compare: .less_equal
|
||||
compare: .less_equal
|
||||
}
|
||||
pipdesc.cull_mode = .back
|
||||
|
||||
|
@ -330,7 +330,7 @@ fn draw_cube_glsl_i(mut app App) {
|
|||
// vfmt on
|
||||
}
|
||||
range := gfx.Range{
|
||||
ptr: unsafe { &app.inst_pos }
|
||||
ptr: unsafe { &app.inst_pos }
|
||||
size: usize(num_inst * int(sizeof(m4.Vec4)))
|
||||
}
|
||||
gfx.update_buffer(app.bind['inst'].vertex_buffers[1], &range)
|
||||
|
@ -340,7 +340,7 @@ fn draw_cube_glsl_i(mut app App) {
|
|||
// passing the view matrix as uniform
|
||||
// res is a 4x4 matrix of f32 thus: 4*16 byte of size
|
||||
vs_uniforms_range := gfx.Range{
|
||||
ptr: unsafe { &tr_matrix }
|
||||
ptr: unsafe { &tr_matrix }
|
||||
size: usize(4 * 16)
|
||||
}
|
||||
gfx.apply_uniforms(.vs, C.SLOT_vs_params_i, &vs_uniforms_range)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue