-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgpu_android.go
36 lines (30 loc) · 1.27 KB
/
gpu_android.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2022, Cogent Core. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build android
package vgpu
import vk "github.com/goki/vulkan"
// Set this variable to true prior to initializing the GPU
// when using the Swiftshader software emulator (used
// by the android studio emulator on macos) or other such
// emulators that fail due to the need for the standard
// DeviceFeaturesNeeded.
var AndroidSoftwareEmulator = false
func PlatformDefaults(gp *GPU) {
if AndroidSoftwareEmulator {
gp.DeviceFeaturesNeeded = &vk.PhysicalDeviceVulkan12Features{
SType: vk.StructureTypePhysicalDeviceVulkan12Features,
}
} else {
gp.DeviceFeaturesNeeded = &vk.PhysicalDeviceVulkan12Features{
SType: vk.StructureTypePhysicalDeviceVulkan12Features,
DescriptorBindingVariableDescriptorCount: vk.True,
DescriptorBindingPartiallyBound: vk.True,
RuntimeDescriptorArray: vk.True,
DescriptorIndexing: vk.True, // might not be needed? not for phong or vdraw
DescriptorBindingSampledImageUpdateAfterBind: vk.True, // might not be needed? not for phong or vdraw
}
}
}
func Terminate() {
}