summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_scene_occlusion_cull.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/rendering/renderer_scene_occlusion_cull.cpp')
-rw-r--r--servers/rendering/renderer_scene_occlusion_cull.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/rendering/renderer_scene_occlusion_cull.cpp b/servers/rendering/renderer_scene_occlusion_cull.cpp
index bda0950097..627e6941cf 100644
--- a/servers/rendering/renderer_scene_occlusion_cull.cpp
+++ b/servers/rendering/renderer_scene_occlusion_cull.cpp
@@ -60,6 +60,8 @@ void RendererSceneOcclusionCull::HZBuffer::clear() {
if (debug_image.is_valid()) {
debug_image.unref();
}
+
+ ERR_FAIL_NULL(RenderingServer::get_singleton());
RS::get_singleton()->free(debug_texture);
}
@@ -180,7 +182,7 @@ RID RendererSceneOcclusionCull::HZBuffer::get_debug_texture() {
ptrw[i] = MIN(mips[0][i] / debug_tex_range, 1.0) * 255;
}
- debug_image->create(sizes[0].x, sizes[0].y, false, Image::FORMAT_L8, debug_data);
+ debug_image->set_data(sizes[0].x, sizes[0].y, false, Image::FORMAT_L8, debug_data);
if (debug_texture.is_null()) {
debug_texture = RS::get_singleton()->texture_2d_create(debug_image);