for some reason I broke it. I think it has to do with the glsl layout
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
|
||||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer Data {
|
||||
int data[];
|
||||
} data;
|
||||
layout(set = 0, binding = 0) buffer wData {
|
||||
int buf[];
|
||||
} write_buffer;
|
||||
|
||||
layout(set = 0, binding = 1) buffer Data1 {
|
||||
int odata[];
|
||||
} odata;
|
||||
layout(set = 0, binding = 1) buffer rData {
|
||||
int buf[];
|
||||
} read_buffer;
|
||||
|
||||
layout(set = 0, binding = 2) buffer Settings {
|
||||
int settings[];
|
||||
@@ -39,20 +39,15 @@ void main() {
|
||||
|
||||
uint idx = get_idx(0,0);
|
||||
|
||||
ivec4 p = separate(odata.odata[get_idx(0,0)]);
|
||||
|
||||
ivec4 p0 = separate(odata.odata[get_idx(0, 1)]);
|
||||
ivec4 p1 = separate(odata.odata[get_idx(0,-1)]);
|
||||
|
||||
ivec4 p2 = separate(odata.odata[get_idx(1, 1)]);
|
||||
ivec4 p3 = separate(odata.odata[get_idx(-1,-1)]);
|
||||
|
||||
ivec4 p4 = separate(odata.odata[get_idx(1, 0)]);
|
||||
ivec4 p5 = separate(odata.odata[get_idx(-1,0)]);
|
||||
|
||||
ivec4 p6 = separate(odata.odata[get_idx(1,-1)]);
|
||||
ivec4 p7 = separate(odata.odata[get_idx(-1,1)]);
|
||||
|
||||
ivec4 p = separate(read_buffer.buf[get_idx(0 , 0)]);
|
||||
ivec4 p0 = separate(read_buffer.buf[get_idx(0 , 1)]);
|
||||
ivec4 p1 = separate(read_buffer.buf[get_idx(0 ,-1)]);
|
||||
ivec4 p2 = separate(read_buffer.buf[get_idx(1 , 1)]);
|
||||
ivec4 p3 = separate(read_buffer.buf[get_idx(-1,-1)]);
|
||||
ivec4 p4 = separate(read_buffer.buf[get_idx(1 , 0)]);
|
||||
ivec4 p5 = separate(read_buffer.buf[get_idx(-1, 0)]);
|
||||
ivec4 p6 = separate(read_buffer.buf[get_idx(1 ,-1)]);
|
||||
ivec4 p7 = separate(read_buffer.buf[get_idx(-1, 1)]);
|
||||
|
||||
ivec3 d0 = abs(p0.xyz - p1.xyz);
|
||||
ivec3 d1 = abs(p2.xyz - p3.xyz);
|
||||
@@ -61,17 +56,23 @@ void main() {
|
||||
|
||||
ivec3 m = max(max(max(d0, d1), d2), d3);
|
||||
|
||||
if ((m.x + m.y + m.z) > 150){
|
||||
if ((m.x + m.y + m.z) > 1){
|
||||
p.x = 0;
|
||||
p.y = 0;
|
||||
p.z = 255;
|
||||
}
|
||||
|
||||
p.x = 0;
|
||||
p.y = 0;
|
||||
p.z = 255;
|
||||
// p.z = max(p.z - (d0.x + d0.y + d0.z + d1.x + d1.y + d1.z)/5, 0);
|
||||
|
||||
data.data[idx] = (data.data[idx] & (~0x000000FF) ) | (p.x);
|
||||
data.data[idx] = (data.data[idx] & (~0x0000FF00) ) | (p.y << 8);
|
||||
data.data[idx] = (data.data[idx] & (~0x00FF0000) ) | (p.z << 16);
|
||||
data.data[idx] = (data.data[idx] & (~0xFF000000) ) | (p.w << 24);
|
||||
write_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
|
||||
write_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
|
||||
write_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
|
||||
write_buffer.buf[idx] = (read_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24);
|
||||
|
||||
//read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
|
||||
//read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
|
||||
//read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
|
||||
//read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24);
|
||||
}
|
||||
Reference in New Issue
Block a user