summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-07-29 18:19:31 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 11:58:16 +0100
commitdc3b47f3abbeb271ca16ce54f2c965099d4ae492 (patch)
treed86db481912b42489b5d1ce37867c11e707a596f /servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
parentb52a2f3dfa9bacb84ba40dadbb0ed3c32c5d3afd (diff)
Vulkan/RD rasterizer now does clean exit.
Diffstat (limited to 'servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp')
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
index 3687687dcc..f0d51f514a 100644
--- a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
@@ -2559,10 +2559,24 @@ RasterizerCanvasRD::~RasterizerCanvasRD() {
//canvas state
- if (state.canvas_state_buffer.is_valid()) {
- RD::get_singleton()->free(state.canvas_state_buffer);
+ {
+ if (state.canvas_state_buffer.is_valid()) {
+ RD::get_singleton()->free(state.canvas_state_buffer);
+ }
+
+ memdelete_arr(state.light_uniforms);
+ RD::get_singleton()->free(state.lights_uniform_buffer);
+ RD::get_singleton()->free(shader.default_skeleton_uniform_buffer);
+ RD::get_singleton()->free(shader.default_skeleton_texture_buffer);
}
+ //shadow rendering
+ {
+
+ shadow_render.shader.version_free(shadow_render.shader_version);
+ //this will also automatically clear all pipelines
+ RD::get_singleton()->free(state.shadow_sampler);
+ }
//bindings
{
@@ -2589,8 +2603,15 @@ RasterizerCanvasRD::~RasterizerCanvasRD() {
shader.canvas_shader.version_free(shader.default_version);
//buffers
- RD::get_singleton()->free(shader.quad_index_array);
- RD::get_singleton()->free(shader.quad_index_buffer);
+ {
+ RD::get_singleton()->free(shader.quad_index_array);
+ RD::get_singleton()->free(shader.quad_index_buffer);
+ RD::get_singleton()->free(polygon_buffers.default_bone_buffer);
+ RD::get_singleton()->free(polygon_buffers.default_weight_buffer);
+ RD::get_singleton()->free(polygon_buffers.default_color_buffer);
+ RD::get_singleton()->free(polygon_buffers.default_uv_buffer);
+ //primitives are erase by dependency
+ }
//pipelines don't need freeing, they are all gone after shaders are gone
}