• Create Account

### #Actualme_12

Posted 14 October 2013 - 03:28 PM

Ah thank you for that tip with GPUView. Before I try getting this to work maybe ATEFred knows the answer about the question if they run in parallel or series.

Because actually I would need them to run in series. I am doing something like this:

for(int i = 0; i < x; i++) {
// 1. update a small constant buffer which holds data for the upcoming particle spawns processed in the dispatch call
// 2. Dispatch(1,1,1);
}

So if this constant buffer gets overwritten by the second loop while the first dispatch is not done it would access wrong data. :/

I could also do it like this:

// 1. bind 250kb data to hold the full spawn over time graph processed in this dispatch call
// 2. Dispatch(x,1,1);


The thing is, that the x is variable. Its random based on time passed. It can be 1 or it can be 30000. But mostly, like 99% of the time it will be 1.

Thats why I thought it might be better to just pass the data actually needed in small junks and process only that bit. And if it happens that I actually need more than 1 pass, I would just use a loop.

Maybe there is even another solution i haven't noticed yet.

If it was only possible to allocate memory dynamically... but no I have to allocate as much memory as is needed in the worst case.

### #5me_12

Posted 14 October 2013 - 03:05 PM

Ah thank you for that tip with GPUView. Before I try getting this to work maybe ATEFred knows the answer about the question if they run in parallel or series.

Because actually I would need them to run in series. I am doing something like this:

for(int i = 0; i < x; i++) {
// 1. update a small constant buffer which holds data for the upcoming particle spawns processed in the dispatch call
// 2. Dispatch(1,1,1);
}

So if this constant buffer gets overwritten by the second loop while the first dispatch is not done it would access wrong data. :/

I could also do it like this:

// 1. for each particle system in the game i would need to bind 250kb data to hold the full spawn over time graph processed in this dispatch call
// 2. Dispatch(x,1,1);


The thing is, that the x is variable. Its random based on time passed. It can be 1 or it can be 30000. But mostly, like 99% of the time it will be 1.

Thats why I thought it might be better to just pass the data actually needed in small junks and process only that bit. And if it happens that I actually need more than 1 pass, I would just use a loop.

Maybe there is even another solution i haven't noticed yet.

If it was only possible to allocate memory dynamically... but no I have to allocate as much memory as is needed in the worst case.

### #4me_12

Posted 14 October 2013 - 03:00 PM

Ah thank you for that tip with GPUView. Before I try getting this to work maybe ATEFred knows the answer about the question if they run in parallel or series.

Because actually I would need them to run in series. I am doing something like this:

for(int i = 0; i < x; i++) {
// 1. update a small constant buffer which holds data for the upcoming particle spawns processed in the dispatch call
// 2. Dispatch(1,1,1);
}

So if this constant buffer gets overwritten by the second loop while the first dispatch is not done it would access wrong data. :/

I could also do it like this:

// 1. for each particle system in the game i would need to bind 250kb data to hold the full spawn over time graph processed in this dispatch call
// 2. Dispatch(x,1,1);


The thing is, that the x is variable. Its random based on time passed. It can be 1 or it can be 300. But mostly, like 99% of the time it will be 1.

Thats why I thought it might be better to just pass the data actually needed in small junks and process only that bit. And if it happens that I actually need more than 1 pass, I would just use a loop.

Maybe there is even another solution i haven't noticed yet.

If it was only possible to allocate memory dynamically... but no I have to allocate as much memory as is needed in the worst case.

### #3me_12

Posted 14 October 2013 - 02:58 PM

Ah thank you for that tip with GPUView. Before I try getting this to work maybe ATEFred knows the answer about the question if they run in parallel or series.

Because actually I would need them to run in series. I am doing something like this:

for(int i = 0; i < x; i++) {
// 1. update a small constant buffer which holds data for the upcoming particle spawns processed in the dispatch call
// 2. Dispatch(1,1,1);
}

So if this constant buffer gets overwritten by the second loop while the first dispatch is not done it would access wrong data. :/

I could also do it like this:

// 1. for each particle system in the game i would need to bind 250kb data to hold the full spawn over time graph processed in this dispatch call
// 2. Dispatch(x,1,1);


The thing is, that the x is variable. Its random based on time passed. It can be 1 or it can be 300. But mostly, like 99% of the time it will be 1.

Thats why I thought it might be better to just pass the data actually needed in small junks and process only that bit. And if it happens that I actually need more than 1 pass, I would just use a loop.

Maybe there is even another solution i haven't noticed yet.

### #2me_12

Posted 14 October 2013 - 02:07 PM

Ah thank you for that tip with GPUView. Before I try getting this to work maybe ATEFred knows the answer about the question if they run in parallel or series.

Because actually I would need them to run in series. I am doing something like this:

for(int i = 0; i < 10; i++) {
// 1. update a small constant buffer which holds data for the dispatch
// 2. Dispatch(1,1,1);
}

So if this constant buffer gets overwritten by the second loop while the first dispatch is not done it would access wrong data. :/

I could also do it like this:

// 1. update a big (about 100 kb) buffer which holds data for the dispatch
// 2. Dispatch(10,1,1);


The thing is, that the 10 I mention all the time is variable. Its random based on time passed. It can be 1 or it can be 300. But mostly, like 99% of the time it will be 1.

Thats why I thought it might be better to just pass the data actually needed in a small junk and process only that bit. And if it happens that I actually need more than 1 pass, I would just use a loop.

Maybe there is even another solution i haven't noticed yet.

### #1me_12

Posted 14 October 2013 - 02:05 PM

Ah thank you for that tip with GPUView. Before I try getting this to work maybe ATEFred knows the answer about the question if they run in parallel or series.

Because actually I would need them to run in series. I am doing something like this:

for(int i = 0; i < 10; i++) {
// 1. update a small constant buffer which holds data for the dispatch
// 2. Dispatch(1,1,1);
}

So if this constant buffer gets overwritten by the second loop while the first dispatch is not done it would access wrong data. :/

I could also do it like this:

// 1. update a big (about 100 kb) data structure (constant buffer cant hold that much data) which holds data for the dispatch
// 2. Dispatch(10,1,1);


The thing is, that the 10 I mention all the time is variable. Its random based on time passed. It can be 1 or it can be 300. But mostly, like 99% of the time it will be 1.

Thats why I thought it might be better to just pass the data actually needed in a small junk and process only that bit. And if it happens that I actually need more than 1 pass, I would just use a loop.

Maybe there is even another solution i haven't noticed yet.

PARTNERS