diff options
Diffstat (limited to 'runtime/src/predicated_copy.comp')
| -rw-r--r-- | runtime/src/predicated_copy.comp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/src/predicated_copy.comp b/runtime/src/predicated_copy.comp new file mode 100644 index 000000000..0a105554d --- /dev/null +++ b/runtime/src/predicated_copy.comp | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | // Synthetic byte-granular buffer copy, executed inside the captured conditional-rendering scope. | ||
| 2 | #version 450 | ||
| 3 | #extension GL_EXT_shader_8bit_storage : require | ||
| 4 | layout(local_size_x=64) in; | ||
| 5 | layout(set=0,binding=0,std430) readonly buffer Source { uint8_t bytes[]; } source; | ||
| 6 | layout(set=0,binding=1,std430) buffer Destination { uint8_t bytes[]; } destination; | ||
| 7 | layout(push_constant) uniform Copy { uint source_offset; uint destination_offset; uint size; } copy; | ||
| 8 | void main() { | ||
| 9 | uint i=gl_GlobalInvocationID.x; | ||
| 10 | if(i<copy.size) destination.bytes[copy.destination_offset+i]=source.bytes[copy.source_offset+i]; | ||
| 11 | } | ||