Skip to content

Commit 299fc52

Browse files
committed
Destroy in 6 to 10
1 parent c1de24f commit 299fc52

5 files changed

Lines changed: 44 additions & 5 deletions

File tree

  • 06_render_targets/sources
  • 07_multiple_render_targets/sources
  • 08_float_render_targets/sources
  • 09_depth_render_targets/sources
  • 10_cubemap/sources

06_render_targets/sources/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void update(void *data) {
6666
.texture = framebuffer,
6767
};
6868

69-
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, width, height, 1);
69+
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, framebuffer->width, framebuffer->height, 1);
7070

7171
#ifdef SCREENSHOT
7272
screenshot_take(&device, &list, framebuffer, width, height);
@@ -133,5 +133,11 @@ int kickstart(int argc, char **argv) {
133133

134134
kore_start();
135135

136+
kore_gpu_buffer_destroy(&indices);
137+
kong_destroy_buffer_vertex_in(&vertices);
138+
kore_gpu_texture_destroy(&render_target);
139+
kore_gpu_command_list_destroy(&list);
140+
kore_gpu_device_destroy(&device);
141+
136142
return 0;
137143
}

07_multiple_render_targets/sources/main.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,25 @@ static void update(void *data) {
7373
.origin_z = 0,
7474
};
7575

76-
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, width / 2, height / 2, 1);
76+
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, framebuffer->width / 2, framebuffer->height / 2, 1);
7777

7878
destination.origin_x = width / 2;
7979
destination.origin_y = 0;
8080
source.texture = &render_targets[1];
8181

82-
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, width / 2, height / 2, 1);
82+
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, framebuffer->width / 2, framebuffer->height / 2, 1);
8383

8484
destination.origin_x = 0;
8585
destination.origin_y = height / 2;
8686
source.texture = &render_targets[2];
8787

88-
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, width / 2, height / 2, 1);
88+
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, framebuffer->width / 2, framebuffer->height / 2, 1);
8989

9090
destination.origin_x = width / 2;
9191
destination.origin_y = height / 2;
9292
source.texture = &render_targets[3];
9393

94-
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, width / 2, height / 2, 1);
94+
kore_gpu_command_list_copy_texture_to_texture(&list, &source, &destination, framebuffer->width / 2, framebuffer->height / 2, 1);
9595

9696
#ifdef SCREENSHOT
9797
screenshot_take(&device, &list, framebuffer, width, height);
@@ -163,5 +163,13 @@ int kickstart(int argc, char **argv) {
163163

164164
kore_start();
165165

166+
kore_gpu_buffer_destroy(&indices);
167+
kong_destroy_buffer_vertex_in(&vertices);
168+
for (uint32_t i = 0; i < 4; ++i) {
169+
kore_gpu_texture_destroy(&render_targets[i]);
170+
}
171+
kore_gpu_command_list_destroy(&list);
172+
kore_gpu_device_destroy(&device);
173+
166174
return 0;
167175
}

08_float_render_targets/sources/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static void update(void *data) {
2828
kore_gpu_device_wait_until_idle(&device);
2929
kore_gpu_texture_destroy(&float_render_target);
3030
kore_gpu_texture_destroy(&render_target);
31+
kong_destroy_compute_set(&set);
3132

3233
width = framebuffer->width;
3334
height = framebuffer->height;
@@ -246,5 +247,13 @@ int kickstart(int argc, char **argv) {
246247

247248
kore_start();
248249

250+
kong_destroy_compute_set(&set);
251+
kore_gpu_buffer_destroy(&indices);
252+
kong_destroy_buffer_vertex_in(&vertices);
253+
kore_gpu_texture_destroy(&render_target);
254+
kore_gpu_texture_destroy(&float_render_target);
255+
kore_gpu_command_list_destroy(&list);
256+
kore_gpu_device_destroy(&device);
257+
249258
return 0;
250259
}

09_depth_render_targets/sources/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,13 @@ int kickstart(int argc, char **argv) {
199199

200200
kore_start();
201201

202+
kong_destroy_fs_set(&set);
203+
kong_destroy_buffer_fs_vertex_in(&vertices_fs);
204+
kore_gpu_buffer_destroy(&indices);
205+
kong_destroy_buffer_vertex_in(&vertices);
206+
kore_gpu_texture_destroy(&render_target);
207+
kore_gpu_command_list_destroy(&list);
208+
kore_gpu_device_destroy(&device);
209+
202210
return 0;
203211
}

10_cubemap/sources/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,13 @@ int kickstart(int argc, char **argv) {
198198

199199
kore_start();
200200

201+
kong_destroy_fs_set(&set);
202+
kong_destroy_buffer_fs_vertex_in(&vertices_fs);
203+
kore_gpu_buffer_destroy(&indices);
204+
kong_destroy_buffer_vertex_in(&vertices);
205+
kore_gpu_texture_destroy(&render_target);
206+
kore_gpu_command_list_destroy(&list);
207+
kore_gpu_device_destroy(&device);
208+
201209
return 0;
202210
}

0 commit comments

Comments
 (0)