53 lines
1.6 KiB
Go
53 lines
1.6 KiB
Go
package device
|
|
|
|
import (
|
|
"github.com/vkngwrapper/core/v2/common"
|
|
"github.com/vkngwrapper/core/v2/core1_0"
|
|
"github.com/vkngwrapper/extensions/v2/ext_descriptor_indexing"
|
|
"github.com/vkngwrapper/extensions/v2/khr_swapchain"
|
|
)
|
|
|
|
var deviceExtensions = []string{
|
|
khr_swapchain.ExtensionName,
|
|
}
|
|
|
|
func _DeviceExtension() []string {
|
|
return deviceExtensions
|
|
}
|
|
|
|
// todo: check QueueFamilyProperty;
|
|
func _QueueCreateInfos(families []*core1_0.QueueFamilyProperties) []core1_0.DeviceQueueCreateInfo {
|
|
var queueFamilyOptions []core1_0.DeviceQueueCreateInfo
|
|
for k, _ := range families {
|
|
queueFamilyOptions = append(queueFamilyOptions, core1_0.DeviceQueueCreateInfo{
|
|
QueueFamilyIndex: k,
|
|
QueuePriorities: []float32{1},
|
|
})
|
|
}
|
|
return queueFamilyOptions
|
|
}
|
|
|
|
// todo: what's means the nextoption?
|
|
func _NextOptions() common.NextOptions {
|
|
indexingFeatures := ext_descriptor_indexing.PhysicalDeviceDescriptorIndexingFeatures{
|
|
ShaderSampledImageArrayNonUniformIndexing: true,
|
|
RuntimeDescriptorArray: true,
|
|
DescriptorBindingPartiallyBound: true,
|
|
DescriptorBindingVariableDescriptorCount: true,
|
|
DescriptorBindingUpdateUnusedWhilePending: true,
|
|
//DescriptorBindingUniformBufferUpdateAfterBind: true,
|
|
DescriptorBindingSampledImageUpdateAfterBind: true,
|
|
DescriptorBindingStorageBufferUpdateAfterBind: true,
|
|
DescriptorBindingStorageTexelBufferUpdateAfterBind: true,
|
|
}
|
|
return common.NextOptions{Next: indexingFeatures}
|
|
}
|
|
|
|
// todo: check DeviceFeature and what's means;
|
|
func _EnabledFeatures() *core1_0.PhysicalDeviceFeatures {
|
|
return &core1_0.PhysicalDeviceFeatures{
|
|
IndependentBlend: true,
|
|
DepthClamp: true,
|
|
}
|
|
}
|