Handle empty child list in traversal shader
This commit is contained in:
@@ -28,6 +28,7 @@ struct UnpackedNode {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define NULL_NODE ((1<<24)-1)
|
#define NULL_NODE ((1<<24)-1)
|
||||||
|
#define EMPTY_QUEUE_ID ((1<<24)-2)
|
||||||
#define NULL_MESH ((1<<24)-1)
|
#define NULL_MESH ((1<<24)-1)
|
||||||
#define EMPTY_MESH ((1<<24)-2)
|
#define EMPTY_MESH ((1<<24)-2)
|
||||||
|
|
||||||
@@ -63,6 +64,10 @@ bool hasChildren(in UnpackedNode node) {
|
|||||||
return node.childPtr != NULL_NODE;
|
return node.childPtr != NULL_NODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool childListIsEmpty(in UnpackedNode node) {
|
||||||
|
return node.childPtr == EMPTY_QUEUE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
bool isEmpty(in UnpackedNode node) {
|
bool isEmpty(in UnpackedNode node) {
|
||||||
return (node.flags&2u) != 0;
|
return (node.flags&2u) != 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ void addRequest(inout UnpackedNode node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void enqueueChildren(in UnpackedNode node) {
|
void enqueueChildren(in UnpackedNode node) {
|
||||||
|
if (childListIsEmpty(node)) {//Occures in a very rare case/instance so just handle it gracefully
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint children = getChildCount(node);
|
uint children = getChildCount(node);
|
||||||
pushNodesInit(children);
|
pushNodesInit(children);
|
||||||
uint ptr = getChildPtr(node);
|
uint ptr = getChildPtr(node);
|
||||||
|
|||||||
Reference in New Issue
Block a user