somehow lost texturing need to look back

master
mitchellhansen 5 years ago
parent bf3abfe29d
commit 709a617cd1

@ -10,6 +10,7 @@ layout(location = 0) out vec4 f_color;
// This is bound by the descriptor set
// Currently handled by the individual buffer and are 1:1
layout(set = 0, binding = 0, rgba32ui) readonly uniform uimage2D img;
void main() {
ivec2 pos = ivec2(gl_FragCoord.x, gl_FragCoord.y);
@ -18,5 +19,5 @@ void main() {
float gamma = 0.5;
f_color.rgb = pow(f_color.rgb, vec3(1.0/gamma));
f_color = vec4(1,1,1,0.5);
}

@ -195,6 +195,7 @@ impl CanvasState {
/// Using the dimensions and suggested usage, load a CanvasImage and return it's handle
pub fn create_image(&mut self, dimensions: (u32, u32), usage: ImageUsage) -> Arc<CanvasImageHandle> {
let handle = Arc::new(CanvasImageHandle { handle: self.image_buffers.len() as u32 });
let image = CanvasImage {
@ -371,7 +372,7 @@ impl CanvasState {
self.textured_vertex_buffer.insert(
k.clone(),
ImmutableBuffer::from_iter(
v.first().unwrap().iter().cloned(),
v.first().unwrap().iter().cloned(), // I don't think doing a first is the right thing
BufferUsage::vertex_buffer(),
self.queue.clone(),
).unwrap().0,

@ -97,9 +97,9 @@ pub fn main() {
let mut mouse_xy = Vector2i::new(0, 0);
let sprite = Sprite::new_with_color((0., 0.), (0.1, 0.1), (1., 0., 0., 1.));
let sprite2 = Sprite::new_with_color((-1., -0.5), (0.1, 0.1), (0., 1., 0., 1.));
let sprite2 = Sprite::new_with_color((-0.3, -0.5), (0.1, 0.1), (0., 1., 0., 1.));
let compu_sprite1 = CompuSprite::new((-1., -0.5), (0.1, 0.1),
let compu_sprite1 = CompuSprite::new((-1., -0.5), (0.4, 0.4),
// This swap image needs to match the size of the compute
processor.new_swap_image((720, 756)));
@ -172,7 +172,7 @@ pub fn main() {
canvas.draw(&sprite);
canvas.draw(&sprite2);
canvas.draw(&sprite3);
//canvas.draw(&compu_sprite1);
canvas.draw(&compu_sprite1);
{
let g = hprof::enter("Run");
processor.run(&surface,

Loading…
Cancel
Save