Skip to content

Commit fae57c5

Browse files
committed
Fix rid not being cleared
1 parent 0afeef1 commit fae57c5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

generators/generate_block_gpu_task.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void GenerateBlockGPUTask::prepare(GPUTaskContext &ctx) {
151151
// Note, this internally locks RenderingDeviceVulkan's class mutex. Which means it could perhaps be used outside
152152
// of the compute list (which already locks the class mutex until it ends). Thankfully, it uses a recursive
153153
// Mutex (instead of BinaryMutex)
154-
const RID generator_uniform_set =
154+
_generator_uniform_set =
155155
zylann::godot::uniform_set_create(rd, generator_uniforms, generator_shader_rid, 0);
156156

157157
{
@@ -160,7 +160,7 @@ void GenerateBlockGPUTask::prepare(GPUTaskContext &ctx) {
160160
}
161161
{
162162
ZN_PROFILE_SCOPE_NAMED("compute_list_bind_uniform_set");
163-
rd.compute_list_bind_uniform_set(compute_list_id, generator_uniform_set, 0);
163+
rd.compute_list_bind_uniform_set(compute_list_id, _generator_uniform_set, 0);
164164
}
165165

166166
const Box3i &box = boxes_to_generate[box_index];
@@ -464,7 +464,8 @@ void GenerateBlockGPUTask::collect(GPUTaskContext &ctx) {
464464
}
465465

466466
zylann::godot::free_rendering_device_rid(rd, _generator_pipeline_rid);
467-
467+
zylann::godot::free_rendering_device_rid(rd, _generator_uniform_set);
468+
468469
for (RID rid : _modifier_pipelines) {
469470
zylann::godot::free_rendering_device_rid(rd, rid);
470471
}

generators/generate_block_gpu_task.h

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class GenerateBlockGPUTask : public IGPUTask {
8383

8484
StdVector<BoxData> _boxes_data;
8585
RID _generator_pipeline_rid;
86+
RID _generator_uniform_set;
8687
StdVector<RID> _modifier_pipelines;
8788
};
8889

0 commit comments

Comments
 (0)