Skip to content

Commit 4bb8f65

Browse files
committed
added wiki and fixed VCT
1 parent 8fd700f commit 4bb8f65

26 files changed

Lines changed: 381 additions & 287 deletions

.idea/gradle.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Renthyl is a modular FrameGraph-based rendering pipeline designed with efficienc
44

55
## Features
66

7+
8+
79
* Allows for the use of modern rendering paradigms, such as deferred and forward++.
810
* Code-first design makes constructing and manipulating FrameGraphs incredibly easy.
911
* Easily control the layout of the FrameGraph using game logic.

RenthylCore/src/main/java/codex/renthyl/FrameGraph.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ public <T extends RenderModule> T add(T module, int index) {
322322
* @param inTicket name of the input ticket on each pass
323323
* @param outTicket name of the output ticket on each pass
324324
* @return array of passes
325-
* @see PassThread#addLoop(T[], int, java.util.function.Supplier, java.lang.String, java.lang.String)
326325
*/
327326
public <T extends RenderModule> T[] addLoop(T[] array, Function<Integer, T> factory,
328327
String inTicket, String outTicket) {
@@ -343,7 +342,6 @@ public <T extends RenderModule> T[] addLoop(T[] array, Function<Integer, T> fact
343342
* @param inTicket name of the input ticket on each pass
344343
* @param outTicket name of the output ticket on each pass
345344
* @return array of passes
346-
* @see PassThread#addLoop(T[], int, java.util.function.Supplier, java.lang.String, java.lang.String)
347345
*/
348346
public <T extends RenderModule> T[] addLoop(T[] array, int index,
349347
Function<Integer, T> function, String inTicket, String outTicket) {
@@ -697,7 +695,7 @@ public boolean isLayoutUpdateNeeded() {
697695
}
698696

699697
/**
700-
* Returns true if this framegraph is running asynchronous {@link PassThread PassThreads}.
698+
* Returns true if this framegraph is running asynchronously.
701699
*
702700
* @return
703701
*/

RenthylCore/src/main/java/codex/renthyl/jobs/FGExecutionJob.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,14 @@ public boolean isEmpty() {
8484
public int getIndex() {
8585
return index;
8686
}
87+
88+
/**
89+
* Returns true if this job is designated to run on the main application thread.
90+
*
91+
* @return
92+
*/
93+
public boolean isMainJob() {
94+
return index == 0;
95+
}
8796

8897
}

RenthylCore/src/main/java/codex/renthyl/resources/ResourceView.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,12 @@ public class ResourceView <T> {
6868
private boolean temporary = false;
6969
private boolean undefined = false;
7070

71-
public ResourceView(ResourceUser producer, ResourceDef<T> def, String name, int index/*, ResourceTicket<T> declaringTicket*/) {
71+
public ResourceView(ResourceUser producer, ResourceDef<T> def, String name, int index) {
7272
this.producer = producer;
7373
this.def = def;
7474
this.name = name;
7575
this.index = index;
7676
this.lifetime = new TimeFrame(this.producer.getIndex(), 0);
77-
//declaringTicket.setBindFlag();
7877
}
7978

8079
/**
@@ -110,9 +109,10 @@ public boolean release(ResourceList list, ResourceTicket ticket) {
110109
ticket.clearBindFlag();
111110
if (!writeComplete.getAndSet(true)) {
112111
if (!readLock.isHeldByCurrentThread()) {
113-
throw new IllegalStateException("Read lock not acquired before releasing.");
114-
}
115-
if (isReadConcurrent()) {
112+
if (!complete) { // read lock is only required for shared resources
113+
throw new IllegalStateException("Read lock not acquired before releasing.");
114+
}
115+
} else if (isReadConcurrent()) {
116116
readCondition.signalAll();
117117
} else {
118118
readCondition.signal();

RenthylCore/src/main/java/codex/renthyl/resources/tickets/AbstractTicketGroup.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@
3232
import codex.renthyl.export.NamedTicketIndex;
3333
import codex.renthyl.export.TicketIndex;
3434
import codex.renthyl.modules.Connectable;
35-
import java.util.Iterator;
36-
import java.util.Collection;
37-
import java.util.Map;
38-
import java.util.Objects;
35+
36+
import java.util.*;
3937
import java.util.function.Consumer;
4038

4139
/**
@@ -49,6 +47,7 @@ public abstract class AbstractTicketGroup <T> implements TicketGroup<T> {
4947
protected final String name;
5048
protected Connectable owner;
5149
private int connectedTickets = 0;
50+
private final HashSet<ResourceTicket> ticketSet = new HashSet<>();
5251

5352
public AbstractTicketGroup(String name) {
5453
this.name = name;
@@ -79,24 +78,27 @@ public ResourceTicket<T> add(String name) {
7978
return append(new ResourceTicket<>(this, name));
8079
}
8180
@Override
82-
@SuppressWarnings("null")
83-
public int makeInput(TicketGroup<T> source, TicketSelector sourceSelector, TicketSelector targetSelector) {
81+
public int makeInput(TicketGroup<T> source, TicketSelector sourceSelector, TicketSelector targetSelector, boolean allowDoubles) {
8482
int j = 0;
8583
int connections = 0;
8684
for (ResourceTicket<T> t : this) {
8785
if (targetSelector.select(t, j)) {
8886
int i = 0;
8987
for (ResourceTicket<T> s : source) {
90-
if (sourceSelector.select(s, t, i++) && targetSelector.select(t, s, j)) {
88+
if ((allowDoubles || !ticketSet.contains(s)) && sourceSelector.select(s, t, i) && targetSelector.select(t, s, j)) {
9189
t.setSource(s);
92-
System.out.println("connect " + s.getName() + " to " + t.getName());
9390
connections++;
91+
if (!allowDoubles) {
92+
ticketSet.add(s);
93+
}
9494
break;
9595
}
96+
i++;
9697
}
9798
}
9899
j++;
99100
}
101+
ticketSet.clear();
100102
if (connections == 0) {
101103
Renthyl.getInstance().logMissedConnection(sourceSelector, targetSelector);
102104
}

RenthylCore/src/main/java/codex/renthyl/resources/tickets/DynamicTicketList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public Collection<ResourceTicket<T>> getTickets() {
8585
return tickets;
8686
}
8787
@Override
88-
public int makeInput(TicketGroup<T> source, TicketSelector sourceSelector, TicketSelector targetSelector) {
88+
public int makeInput(TicketGroup<T> source, TicketSelector sourceSelector, TicketSelector targetSelector, boolean allowDoubles) {
8989
int i = 0;
9090
int connections = 0;
9191
for (ResourceTicket<T> s : source) {

0 commit comments

Comments
 (0)