@@ -151,16 +151,16 @@ void GenerateBlockGPUTask::prepare(GPUTaskContext &ctx) {
151
151
// Note, this internally locks RenderingDeviceVulkan's class mutex. Which means it could perhaps be used outside
152
152
// of the compute list (which already locks the class mutex until it ends). Thankfully, it uses a recursive
153
153
// Mutex (instead of BinaryMutex)
154
- _generator_uniform_set =
155
- zylann::godot::uniform_set_create (rd, generator_uniforms, generator_shader_rid, 0 );
154
+ const RID generator_uniform_set = zylann::godot::uniform_set_create (rd, generator_uniforms, generator_shader_rid, 0 );
155
+ _generator_uniform_sets. push_back (generator_uniform_set );
156
156
157
157
{
158
158
ZN_PROFILE_SCOPE_NAMED (" compute_list_bind_compute_pipeline" );
159
159
rd.compute_list_bind_compute_pipeline (compute_list_id, _generator_pipeline_rid);
160
160
}
161
161
{
162
162
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 );
164
164
}
165
165
166
166
const Box3i &box = boxes_to_generate[box_index];
@@ -464,7 +464,10 @@ void GenerateBlockGPUTask::collect(GPUTaskContext &ctx) {
464
464
}
465
465
466
466
zylann::godot::free_rendering_device_rid (rd, _generator_pipeline_rid);
467
- zylann::godot::free_rendering_device_rid (rd, _generator_uniform_set);
467
+
468
+ for (RID rid : _generator_uniform_sets) {
469
+ zylann::godot::free_rendering_device_rid (rd, rid);
470
+ }
468
471
469
472
for (RID rid : _modifier_pipelines) {
470
473
zylann::godot::free_rendering_device_rid (rd, rid);
0 commit comments