1160
|
1 import std/os
|
|
2
|
|
3 import semicongine/platform/window
|
|
4 import semicongine/core/vulkanapi
|
|
5 import semicongine/vulkan/instance
|
|
6 import semicongine/vulkan/device
|
|
7 import semicongine/vulkan/physicaldevice
|
|
8 # import ./vulkan/shader
|
|
9
|
|
10 import semicongine/core/vector
|
|
11 import semicongine/core/matrix
|
|
12
|
1159
|
13 type
|
1160
|
14 MeshA = object
|
|
15 positions: seq[Vec3f]
|
|
16 colors: seq[Vec3f]
|
|
17 transparency: float32
|
1161
|
18 InstanceDataA = object
|
1160
|
19 transforms: seq[Vec3f]
|
|
20
|
1159
|
21 Enemy = object
|
1160
|
22 mesh: MeshA
|
1161
|
23 enemies: InstanceDataA
|
1160
|
24
|
|
25 let e = Enemy()
|
|
26 echo e
|
1159
|
27
|
1160
|
28 let w = CreateWindow("test2")
|
|
29 putEnv("VK_LAYER_ENABLES", "VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_AMD,VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_NVIDIA,VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXTVK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT,VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT")
|
|
30 let i = w.CreateInstance(
|
|
31 vulkanVersion = VK_MAKE_API_VERSION(0, 1, 3, 0),
|
|
32 instanceExtensions = @[],
|
|
33 layers = @["VK_LAYER_KHRONOS_validation"],
|
|
34 )
|
|
35
|
|
36 let selectedPhysicalDevice = i.GetPhysicalDevices().FilterBestGraphics()
|
|
37 let d = i.CreateDevice(
|
|
38 selectedPhysicalDevice,
|
|
39 enabledExtensions = @[],
|
|
40 selectedPhysicalDevice.FilterForGraphicsPresentationQueues()
|
|
41 )
|