Skip to content

Commit

Permalink
gg: cleanup in init_pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Sep 29, 2023
1 parent 6fc3a3d commit 137cb09
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions vlib/gg/gg.c.v
Expand Up @@ -117,37 +117,29 @@ fn (mut container PipelineContainer) init_pipeline() {
// FIXME(FireRedz): this looks kinda funny, find a better way to initialize pipeline.

// Alpha
mut alpha_pipdesc := gfx.PipelineDesc{
label: c'alpha-pipeline'
}

mut alpha_pipdesc := gfx.PipelineDesc{}
unsafe { vmemset(&alpha_pipdesc, 0, int(sizeof(alpha_pipdesc))) }

alpha_pipdesc.label = c'alpha-pipeline'
alpha_pipdesc.colors[0] = gfx.ColorState{
blend: gfx.BlendState{
enabled: true
src_factor_rgb: .src_alpha
dst_factor_rgb: .one_minus_src_alpha
}
}

container.alpha = sgl.make_pipeline(&alpha_pipdesc)

// Add
mut add_pipdesc := gfx.PipelineDesc{
label: c'additive-pipeline'
}

mut add_pipdesc := gfx.PipelineDesc{}
unsafe { vmemset(&add_pipdesc, 0, int(sizeof(add_pipdesc))) }

add_pipdesc.label = c'additive-pipeline'
add_pipdesc.colors[0] = gfx.ColorState{
blend: gfx.BlendState{
enabled: true
src_factor_rgb: .src_alpha
dst_factor_rgb: .one
}
}

container.add = sgl.make_pipeline(&add_pipdesc)
}

Expand Down

0 comments on commit 137cb09

Please sign in to comment.