stupid stupid stupid. buffer write bug

master
mitchellhansen 5 years ago
parent e7d4d6a8e2
commit e597e8ef1b

@ -61,15 +61,13 @@ void main() {
p.y = 0; p.y = 0;
p.z = 255; p.z = 255;
} }
p.x = 125;
p.y = 255;
p.z = 255;
// p.z = max(p.z - (d0.x + d0.y + d0.z + d1.x + d1.y + d1.z)/5, 0);
write_buffer.buf[0] = (read_buffer.buf[idx] & (~0x000000FF) ) | (p.x); //p.z = max(p.z - (d0.x + d0.y + d0.z + d1.x + d1.y + d1.z)/5, 0);
//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] = (write_buffer.buf[idx] & (~0x000000FF) ) | (p.x);
//write_buffer.buf[idx] = (read_buffer.buf[idx] & (~0xFF000000) ) | (p.w << 24); write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);
write_buffer.buf[idx] = (write_buffer.buf[idx] & (~0x00FF0000) ) | (p.z << 16);
write_buffer.buf[idx] = (write_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] & (~0x000000FF) ) | (p.x);
// read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8); // read_buffer.buf[idx] = (read_buffer.buf[idx] & (~0x0000FF00) ) | (p.y << 8);

@ -48,6 +48,7 @@ mod input;
mod util; mod util;
fn main() { fn main() {
// Load up the input image, determine some details // Load up the input image, determine some details
let mut img = image::open("resources/images/test2.png").unwrap(); let mut img = image::open("resources/images/test2.png").unwrap();
let xy = img.dimensions(); let xy = img.dimensions();
@ -175,9 +176,9 @@ fn main() {
img.put_pixel(x, y, image::Rgba([r, g, b, a])) img.put_pixel(x, y, image::Rgba([r, g, b, a]))
} }
} }
}// Currently bringing all this start shit outta scope to see if it stops my gpu from screaming }
// Currently bringing all this start shit outta scope to see if it stops my gpu from screaming
println!("Saving output"); println!("Saving output");
img.save(format!("output/{}.png", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs())); img.save(format!("output/{}.png", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs()));
} }

Loading…
Cancel
Save