From e25b20717523e579bb6f1e0d17b635c71bad6fab Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Dec 2024 23:28:00 +1100 Subject: resource names --- c2.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'c2.cpp') diff --git a/c2.cpp b/c2.cpp index 936638d..e88f12d 100644 --- a/c2.cpp +++ b/c2.cpp @@ -29,11 +29,13 @@ struct C2 : public App { static Buffer_Id upload_verts(Device* dev) { Buffer_Id stage = dev->create_buffer( + "temp", sizeof verts, Buffer_Flags::copy_src | Buffer_Flags::cpu_readwrite ); Buffer_Id vbo = dev->create_buffer( + "autism triangle vbo", sizeof verts, Buffer_Flags::vertex_buffer | Buffer_Flags::copy_dst @@ -59,7 +61,7 @@ static Sampler_Id create_clamped_linear(Device* dev) { s.mag = Filter_Mode::linear; s.address_u = Address_Mode::repeat; s.address_v = Address_Mode::repeat; - return dev->create_sampler(s); + return dev->create_sampler("repeated linear", s); } struct Config_Buffer { @@ -80,7 +82,7 @@ extern "C" int entrypoint() { Texture* texture; Texture* texture2; Model* monkey; - Buffer_Id vbo, cbuf, cbuf2; + Buffer_Id vbo, cbuf; Sampler_Id clamped_linear; UI* ui; C2* app = App::create("c2"); @@ -113,15 +115,11 @@ extern "C" int entrypoint() { texture = (Texture*)assets.load("22.tex"); texture2 = (Texture*)assets.load("kita.tex"); cbuf = dev->create_buffer( + "config buffer", sizeof(Config_Buffer), Buffer_Flags::constant_buffer | Buffer_Flags::cpu_readwrite ); - cbuf2 = dev->create_buffer( - sizeof(Config_Buffer2), - Buffer_Flags::constant_buffer | - Buffer_Flags::cpu_readwrite - ); per_frame = heap_alloc( dev->heap, per_frame_memory_size @@ -251,7 +249,6 @@ extern "C" int entrypoint() { dev->destroy_sampler(clamped_linear); dev->destroy_buffer(vbo); dev->destroy_buffer(cbuf); - dev->destroy_buffer(cbuf2); dev->destroy(); app->destroy(); return 0; -- cgit v1.2.3-54-g00ecf