comparison tests/test_vulkan_wrapper.nim @ 582:8cf5d3f921ae

did: refactor GPU data types, more generic, prepare to use for decriptors/uniforms
author Sam <sam@basx.dev>
date Fri, 07 Apr 2023 00:32:07 +0700
parents 87e500bd528a
children 506090173619
comparison
equal deleted inserted replaced
581:87e500bd528a 582:8cf5d3f921ae
54 ) 54 )
55 55
56 # INIT RENDERER: 56 # INIT RENDERER:
57 const 57 const
58 vertexInput = initAttributeGroup( 58 vertexInput = initAttributeGroup(
59 asAttribute(default(Vec3f), "position"), 59 attr[Vec3f]("position"),
60 asAttribute(default(Vec3f), "color"), 60 attr[Vec3f]("color"),
61 ) 61 )
62 vertexOutput = initAttributeGroup(asAttribute(default(Vec3f), "outcolor")) 62 vertexOutput = initAttributeGroup(attr[Vec3f]("outcolor"))
63 fragOutput = initAttributeGroup(asAttribute(default(Vec4f), "color")) 63 fragOutput = initAttributeGroup(attr[Vec4f]("color"))
64 vertexCode = compileGlslShader( 64 vertexCode = compileGlslShader(
65 stage=VK_SHADER_STAGE_VERTEX_BIT, 65 stage=VK_SHADER_STAGE_VERTEX_BIT,
66 inputs=vertexInput, 66 inputs=vertexInput,
67 outputs=vertexOutput, 67 outputs=vertexOutput,
68 body="""gl_Position = vec4(position, 1.0); outcolor = color;""" 68 body="""gl_Position = vec4(position, 1.0); outcolor = color;"""