b8aac3c9bc
Add secondary_cursors field to Editor with insert_char_multi, delete_back_multi, delete_forward_multi methods. Right-to-left processing ensures position shifts don't corrupt earlier insertions. 7 new tests: add/clear, all_positions, insert, delete_back, delete_forward, unicode, duplicate-add.
27 lines
396 B
Plaintext
27 lines
396 B
Plaintext
#version 440
|
|
|
|
layout (local_size_x = 256) in;
|
|
|
|
struct Stuff {
|
|
vec2 a;
|
|
vec2 b;
|
|
};
|
|
|
|
layout(std140, binding = 0) buffer StuffSsbo
|
|
{
|
|
vec4 whatever;
|
|
Stuff stuff[];
|
|
} buf;
|
|
|
|
void main()
|
|
{
|
|
uint index = gl_GlobalInvocationID.x;
|
|
vec2 a = buf.stuff[index].a;
|
|
vec2 b = buf.stuff[index].b;
|
|
|
|
a.x += 1.0;
|
|
buf.stuff[index].a = a;
|
|
b.y += 1.0;
|
|
buf.stuff[index].b = b;
|
|
}
|