MCPcopy Create free account
hub / github.com/cogentcore/core / Config

Method Config

vgpu/framebuffer.go:80–108  ·  view source on GitHub ↗

Config configures a new vulkan framebuffer object with current settings, destroying any existing

()

Source from the content-addressed store, hash-verified

78// Config configures a new vulkan framebuffer object with current settings,
79// destroying any existing
80func (fb *Framebuffer) Config() {
81 fb.DestroyFrame()
82 ivs := []vk.ImageView{}
83 if fb.Render.HasMulti {
84 ivs = append(ivs, fb.Render.Multi.View)
85 } else {
86 ivs = append(ivs, fb.Image.View)
87 }
88 if fb.Render.HasDepth {
89 ivs = append(ivs, fb.Render.Depth.View)
90 }
91 if fb.Render.HasMulti {
92 ivs = append(ivs, fb.Image.View)
93 }
94 w, h := fb.Image.Format.Size32()
95 var frameBuff vk.Framebuffer
96 ret := vk.CreateFramebuffer(fb.Render.Dev, &vk.FramebufferCreateInfo{
97 SType: vk.StructureTypeFramebufferCreateInfo,
98 RenderPass: fb.Render.VkClearPass,
99 AttachmentCount: uint32(len(ivs)),
100 PAttachments: ivs,
101 Width: w,
102 Height: h,
103 Layers: 1,
104 }, nil, &frameBuff)
105 IfPanic(NewError(ret))
106 fb.Framebuffer = frameBuff
107 fb.HasCleared = false
108}
109
110/////////////////////////////////////////////////////////////////
111// RenderFrame functionality

Callers 1

ConfigRenderMethod · 0.95

Calls 4

DestroyFrameMethod · 0.95
IfPanicFunction · 0.85
NewErrorFunction · 0.85
Size32Method · 0.80

Tested by

no test coverage detected