#include "testpipeline.hpp" #include "testpipeline.cpp.hshhead" using namespace hsh::pipeline; struct DrawSomething : pipeline> { DrawSomething(hsh::uniform_buffer u, hsh::vertex_buffer v, hsh::texture2d tex0) { position = u->xf * hsh::float4{v->position, 1.f}; color_out[0] = hsh::float4{1.f, 1.f, 0.f, 1.f}; } }; Binding BuildPipeline() { auto uni = hsh::create_dynamic_uniform_buffer(); std::array VtxData{MyFormat{hsh::float3{-1.f, -1.f, 0.f}, {}}, MyFormat{hsh::float3{1.f, -1.f, 0.f}, {}}, MyFormat{hsh::float3{1.f, 1.f, 0.f}, {}}}; auto vtx = hsh::create_vertex_buffer(VtxData); auto tex = hsh::create_texture2d( {1024, 1024}, hsh::Format::RGBA8_UNORM, 10, [](void* buf, std::size_t size) { std::memset(buf, 0, size); }); Binding ret{std::move(uni), std::move(vtx), std::move(tex), {}}; ret.Binding.hsh_DrawSomething( DrawSomething(ret.Uniform.get(), ret.VBO.get(), ret.Tex.get())); return ret; }