Mercurial > games > semicongine
comparison semiconginev2/rendering/shaders.nim @ 1247:c15770761865
add: gltf loading test, gltf loading for materials
author | sam <sam@basx.dev> |
---|---|
date | Wed, 24 Jul 2024 23:26:34 +0700 |
parents | 42eeb59f3a43 |
children | 01e9f41d35b1 |
comparison
equal
deleted
inserted
replaced
1246:356089365076 | 1247:c15770761865 |
---|---|
34 elif T is TMat43[float32]: "mat43" | 34 elif T is TMat43[float32]: "mat43" |
35 elif T is TMat43[float64]: "dmat43" | 35 elif T is TMat43[float64]: "dmat43" |
36 elif T is TMat4[float32]: "mat4" | 36 elif T is TMat4[float32]: "mat4" |
37 elif T is TMat4[float64]: "dmat4" | 37 elif T is TMat4[float64]: "dmat4" |
38 elif T is Image: "sampler2D" | 38 elif T is Image: "sampler2D" |
39 else: {.error: "Unsupported data type on GPU".} | 39 else: |
40 const n = typetraits.name(T) | |
41 {.error: "Unsupported data type on GPU: " & n.} | |
40 | 42 |
41 func VkType[T: SupportedGPUType](value: T): VkFormat = | 43 func VkType[T: SupportedGPUType](value: T): VkFormat = |
42 when T is float32: VK_FORMAT_R32_SFLOAT | 44 when T is float32: VK_FORMAT_R32_SFLOAT |
43 elif T is float64: VK_FORMAT_R64_SFLOAT | 45 elif T is float64: VK_FORMAT_R64_SFLOAT |
44 elif T is int8: VK_FORMAT_R8_SINT | 46 elif T is int8: VK_FORMAT_R8_SINT |