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

Method Defaults

vgpu/gpu.go:117–129  ·  view source on GitHub ↗

Defaults sets up default parameters, with the graphics flag determining whether graphics-relevant items are added.

(graphics bool)

Source from the content-addressed store, hash-verified

115// Defaults sets up default parameters, with the graphics flag
116// determining whether graphics-relevant items are added.
117func (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.

Callers 2

NewGPUFunction · 0.95
NewComputeGPUFunction · 0.95

Calls 1

PlatformDefaultsFunction · 0.70

Tested by

no test coverage detected