Skip to content

Commit

Permalink
Fix scheduling render-tasks in correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Feb 25, 2025
1 parent 9e1a197 commit eda4f95
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ public boolean scheduleRenderTask(RenderTask task) {
}
}

public int scheduleRenderTasks(RenderTask... tasks) {
synchronized (this.renderTasks) {
int count = 0;
for (RenderTask task : tasks) {
if (scheduleRenderTask(task)) count++;
}
return count;
}
}

public boolean scheduleRenderTaskNext(RenderTask task) {
synchronized (this.renderTasks) {
if (renderTasks.size() <= 1) return scheduleRenderTask(task);
Expand All @@ -164,6 +174,9 @@ public boolean scheduleRenderTaskNext(RenderTask task) {

public int scheduleRenderTasksNext(RenderTask... tasks) {
synchronized (this.renderTasks) {
if (renderTasks.size() <= 1)
return scheduleRenderTasks(tasks);

int count = 0;
for (int i = tasks.length - 1; i >= 0; i--) {
if (scheduleRenderTaskNext(tasks[i])) count++;
Expand Down

0 comments on commit eda4f95

Please sign in to comment.