Config configures a new vulkan framebuffer object with current settings, destroying any existing
()
| 78 | // Config configures a new vulkan framebuffer object with current settings, |
| 79 | // destroying any existing |
| 80 | func (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 |
no test coverage detected