comparison static_utils.nim @ 1189:aceb7697d37c compiletime-tests

RGB no supported, must be RGBA
author sam <sam@basx.dev>
date Sun, 07 Jul 2024 16:42:22 +0700
parents b14861786b61
children
comparison
equal deleted inserted replaced
1188:427c11c0aeb1 1189:aceb7697d37c
1289 objPosition: GPUArray[Vec3f, VertexBuffer] 1289 objPosition: GPUArray[Vec3f, VertexBuffer]
1290 MaterialA = object 1290 MaterialA = object
1291 reflection: float32 1291 reflection: float32
1292 baseColor: Vec3f 1292 baseColor: Vec3f
1293 UniformsA = object 1293 UniformsA = object
1294 defaultTexture: Texture[TVec3[uint8]] 1294 defaultTexture: Texture[TVec4[uint8]]
1295 defaultMaterial: GPUValue[MaterialA, UniformBuffer] 1295 defaultMaterial: GPUValue[MaterialA, UniformBuffer]
1296 materials: GPUValue[array[3, MaterialA], UniformBuffer] 1296 materials: GPUValue[array[3, MaterialA], UniformBuffer]
1297 materialTextures: array[3, Texture[TVec3[uint8]]] 1297 materialTextures: array[3, Texture[TVec4[uint8]]]
1298 ShaderSettings = object 1298 ShaderSettings = object
1299 gamma: float32 1299 gamma: float32
1300 GlobalsA = object 1300 GlobalsA = object
1301 fontAtlas: Texture[TVec3[uint8]] 1301 fontAtlas: Texture[TVec4[uint8]]
1302 settings: GPUValue[ShaderSettings, UniformBuffer] 1302 settings: GPUValue[ShaderSettings, UniformBuffer]
1303 1303
1304 ShaderA = object 1304 ShaderA = object
1305 # vertex input 1305 # vertex input
1306 position {.VertexAttribute.}: Vec3f 1306 position {.VertexAttribute.}: Vec3f
1350 var myMesh1 = MeshA( 1350 var myMesh1 = MeshA(
1351 position: GPUArray[Vec3f, VertexBuffer](data: @[NewVec3f(0, 0, ), NewVec3f(0, 0, ), NewVec3f(0, 0, )]), 1351 position: GPUArray[Vec3f, VertexBuffer](data: @[NewVec3f(0, 0, ), NewVec3f(0, 0, ), NewVec3f(0, 0, )]),
1352 ) 1352 )
1353 var uniforms1 = DescriptorSet[UniformsA, MaterialSet]( 1353 var uniforms1 = DescriptorSet[UniformsA, MaterialSet](
1354 data: UniformsA( 1354 data: UniformsA(
1355 defaultTexture: Texture[TVec3[uint8]](width: 1, height: 1, data: @[TVec3[uint8]([0'u8, 0'u8, 0'u8])]), 1355 defaultTexture: Texture[TVec4[uint8]](width: 1, height: 1, data: @[TVec4[uint8]([0'u8, 0'u8, 0'u8, 1'u8])]),
1356 materials: GPUValue[array[3, MaterialA], UniformBuffer](data: [ 1356 materials: GPUValue[array[3, MaterialA], UniformBuffer](data: [
1357 MaterialA(reflection: 0, baseColor: NewVec3f(1, 0, 0)), 1357 MaterialA(reflection: 0, baseColor: NewVec3f(1, 0, 0)),
1358 MaterialA(reflection: 0.1, baseColor: NewVec3f(0, 1, 0)), 1358 MaterialA(reflection: 0.1, baseColor: NewVec3f(0, 1, 0)),
1359 MaterialA(reflection: 0.5, baseColor: NewVec3f(0, 0, 1)), 1359 MaterialA(reflection: 0.5, baseColor: NewVec3f(0, 0, 1)),
1360 ]), 1360 ]),
1361 materialTextures: [ 1361 materialTextures: [
1362 Texture[TVec3[uint8]](width: 1, height: 1, data: @[TVec3[uint8]([0'u8, 0'u8, 0'u8])]), 1362 Texture[TVec4[uint8]](width: 1, height: 1, data: @[TVec4[uint8]([0'u8, 0'u8, 0'u8, 1'u8])]),
1363 Texture[TVec3[uint8]](width: 1, height: 1, data: @[TVec3[uint8]([0'u8, 0'u8, 0'u8])]), 1363 Texture[TVec4[uint8]](width: 1, height: 1, data: @[TVec4[uint8]([0'u8, 0'u8, 0'u8, 1'u8])]),
1364 Texture[TVec3[uint8]](width: 1, height: 1, data: @[TVec3[uint8]([0'u8, 0'u8, 0'u8])]), 1364 Texture[TVec4[uint8]](width: 1, height: 1, data: @[TVec4[uint8]([0'u8, 0'u8, 0'u8, 1'u8])]),
1365 ] 1365 ]
1366 ) 1366 )
1367 ) 1367 )
1368 var instances1 = InstanceA( 1368 var instances1 = InstanceA(
1369 rotation: GPUArray[Vec4f, VertexBuffer](data: @[NewVec4f(1, 0, 0, 0.1), NewVec4f(0, 1, 0, 0.1)]), 1369 rotation: GPUArray[Vec4f, VertexBuffer](data: @[NewVec4f(1, 0, 0, 0.1), NewVec4f(0, 1, 0, 0.1)]),
1370 objPosition: GPUArray[Vec3f, VertexBuffer](data: @[NewVec3f(0, 0, 0), NewVec3f(1, 1, 1)]), 1370 objPosition: GPUArray[Vec3f, VertexBuffer](data: @[NewVec3f(0, 0, 0), NewVec3f(1, 1, 1)]),
1371 ) 1371 )
1372 var myGlobals = DescriptorSet[GlobalsA, GlobalSet]( 1372 var myGlobals = DescriptorSet[GlobalsA, GlobalSet](
1373 data: GlobalsA( 1373 data: GlobalsA(
1374 fontAtlas: Texture[TVec3[uint8]](width: 1, height: 1, data: @[TVec3[uint8]([0'u8, 0'u8, 0'u8])]), 1374 fontAtlas: Texture[TVec4[uint8]](width: 1, height: 1, data: @[TVec4[uint8]([0'u8, 0'u8, 0'u8, 1'u8])]),
1375 settings: GPUValue[ShaderSettings, UniformBuffer](data: ShaderSettings(gamma: 1.0)) 1375 settings: GPUValue[ShaderSettings, UniformBuffer](data: ShaderSettings(gamma: 1.0))
1376 ) 1376 )
1377 ) 1377 )
1378 1378
1379 # setup for rendering (TODO: swapchain & framebuffers) 1379 # setup for rendering (TODO: swapchain & framebuffers)