# HG changeset patch # User Sam # Date 1678990318 -25200 # Node ID fb42da98c1aa678d06970b81c41974bb64a50d82 # Parent bfb75f2cd493bba235a415e7d72eaea78500beed did: update to use new shader concept diff -r bfb75f2cd493 -r fb42da98c1aa tests/test_vulkan_wrapper.nim --- a/tests/test_vulkan_wrapper.nim Fri Mar 17 01:11:43 2023 +0700 +++ b/tests/test_vulkan_wrapper.nim Fri Mar 17 01:11:58 2023 +0700 @@ -7,6 +7,8 @@ type Vertex = object pos: Vec3 + Uniforms = object + time: float32 when isMainModule: @@ -74,17 +76,28 @@ renderFinished = device.createSemaphore() inflight = device.createFence() - var vertexshader = device.createVertexShader("#version 450\nvoid main() {}", Vertex()) - var fragmentshader = device.createFragmentShader("#version 450\nvoid main() {}") - var pipeline = renderpass.createPipeline(vertexshader, fragmentshader) + var vertexshader = shader(Vertex, Uniforms, device): + shadertype: VK_SHADER_STAGE_VERTEX_BIT + entrypoint: "main" + version: 450 + code: """""" + var fragmentshader = shader(Vertex, Uniforms, device): + shadertype: VK_SHADER_STAGE_FRAGMENT_BIT + entrypoint: "main" + version: 450 + code: "" + + #var vertexshader = loadShaderCode[Vertex, Uniforms](device, vertexshadercode) + #var fragmentshader = loadShaderCode[Vertex, Uniforms](device, fragmentshadercode) + #var pipeline = renderpass.createPipeline(vertexshaderhandle, fragmentshaderhandle) echo "All successfull" echo "Start cleanup" # cleanup - pipeline.destroy() - vertexshader.destroy() - fragmentshader.destroy() + #pipeline.destroy() + #vertexshader.destroy() + #fragmentshader.destroy() inflight.destroy() imageAvailable.destroy() renderFinished.destroy()