# HG changeset patch # User Sam # Date 1678990318 -25200 # Node ID c782d7e52b256e1cc67887a3697307c069cc70d4 # Parent f0ceb8c17d2c21967d794d9bb861bbd5225b5c55 did: update to use new shader concept diff -r f0ceb8c17d2c -r c782d7e52b25 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()