You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a compute shader I am trying to get to take a list of (index, data) pairs and write the data at the given index into a larger buffer, allowing for sparse updates to the larger buffer. The code in the shader looks like this:
let index = global_index.x; let write_index = update_indicies[index]; generation[write_index] += 1; if index < arrayLength(&new_data_buf) { let new_data = new_data_buf[index]; storage_buf[write_index] = new_data; }
I am also using generational indicies so data that is update is marked as such and any handles pointing to that data do not access the wrong thing. The new_data_buf is always shorter then the or equal to the length of the update_indicies.
Here is the problem, whenever I run my code and that shader when I readback "generation" and "storage_buf", they both come back competley zeroed. This makes me think there is a dynamic error occuring in the shader, but I am stumped as to what it could be.
Here is what I have ruled out:
update_indicies containing overlapping indicies and thus causing a data race.
update_indicies containing out of bounds indicies.
unbounded loops - my shader contains no loops.
memory layout mismatch - all the buffers contain simple types, either arrays of floats, or ints, and I have double checked the alignment and size requirments for these and double checked my cpu-side memory representations.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a compute shader I am trying to get to take a list of (index, data) pairs and write the data at the given index into a larger buffer, allowing for sparse updates to the larger buffer. The code in the shader looks like this:
let index = global_index.x;
let write_index = update_indicies[index];
generation[write_index] += 1;
if index < arrayLength(&new_data_buf) {
let new_data = new_data_buf[index];
storage_buf[write_index] = new_data;
}
I am also using generational indicies so data that is update is marked as such and any handles pointing to that data do not access the wrong thing. The new_data_buf is always shorter then the or equal to the length of the update_indicies.
Here is the problem, whenever I run my code and that shader when I readback "generation" and "storage_buf", they both come back competley zeroed. This makes me think there is a dynamic error occuring in the shader, but I am stumped as to what it could be.
Here is what I have ruled out:
Any help is greatley appreciated.
Beta Was this translation helpful? Give feedback.
All reactions