Defaults sets up default parameters, with the graphics flag determining whether graphics-relevant items are added.
(graphics bool)
| 115 | // Defaults sets up default parameters, with the graphics flag |
| 116 | // determining whether graphics-relevant items are added. |
| 117 | func (gp *GPU) Defaults(graphics bool) { |
| 118 | gp.APIVersion = vk.Version(vk.MakeVersion(1, 2, 0)) |
| 119 | gp.AppVersion = vk.Version(vk.MakeVersion(1, 0, 0)) |
| 120 | // TODO: these don't work on mobile, but might be needed on desktop |
| 121 | // gp.DeviceExts = []string{"VK_EXT_descriptor_indexing"} |
| 122 | // gp.InstanceExts = []string{"VK_KHR_get_physical_device_properties2"} |
| 123 | if graphics { |
| 124 | gp.DeviceExts = append(gp.DeviceExts, []string{"VK_KHR_swapchain"}...) |
| 125 | } else { |
| 126 | gp.Compute = true |
| 127 | } |
| 128 | PlatformDefaults(gp) |
| 129 | } |
| 130 | |
| 131 | // NewGPU returns a new GPU struct with Graphics Defaults set |
| 132 | // configure any additional defaults before calling Config. |
no test coverage detected