Skip to content
Snippets Groups Projects
Unverified Commit 2b6df550 authored by TheJackiMonster's avatar TheJackiMonster
Browse files

Fixed issue with invalid invocations

parent da960ac8
No related branches found
No related tags found
1 merge request!106Created initial firework project
...@@ -148,7 +148,7 @@ void main() { ...@@ -148,7 +148,7 @@ void main() {
{ {
const uint tid = atomicAdd(trailIndex, 1) % trails.length(); const uint tid = atomicAdd(trailIndex, 1) % trails.length();
const uint trailLen = 64 + int(randomData[(tid + id) % randomData.length()] * 32); const uint trailLen = 96 + int(randomData[(tid + id) % randomData.length()] * 32);
const uint startIndex = atomicAdd(pointIndex, trailLen) % points.length(); const uint startIndex = atomicAdd(pointIndex, trailLen) % points.length();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
layout(points) in; layout(points) in;
layout (triangle_strip, max_vertices = (INSTANCE_LEN * 2)) out; layout (triangle_strip, max_vertices = (INSTANCE_LEN * 2)) out;
layout(invocations = 32) in; layout(invocations = 8) in;
#include "physics.inc" #include "physics.inc"
#include "point.inc" #include "point.inc"
...@@ -44,9 +44,9 @@ void main() { ...@@ -44,9 +44,9 @@ void main() {
const uint indexOffset = (gl_InvocationID * (INSTANCE_LEN - 1)); const uint indexOffset = (gl_InvocationID * (INSTANCE_LEN - 1));
const uint instanceIndex = startIndex + indexOffset; const uint instanceIndex = startIndex + indexOffset;
uint count = INSTANCE_LEN; uint count = min(INSTANCE_LEN, useCount);
if (indexOffset + INSTANCE_LEN > useCount) { if ((indexOffset >= useCount) && (indexOffset + INSTANCE_LEN > useCount)) {
count = indexOffset - useCount; count = indexOffset - useCount;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment