From feaebc5f4468ec55c09ab9ee9b87c1b86718119d Mon Sep 17 00:00:00 2001 From: chyyran Date: Mon, 23 Sep 2024 23:55:50 -0400 Subject: [PATCH] fmt(gl): cargo fmt --- .../src/gl/gl3/draw_quad.rs | 6 ++---- librashader-runtime-gl/src/gl/gl3/ubo_ring.rs | 21 +++++++------------ .../src/gl/gl46/ubo_ring.rs | 17 ++++++--------- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/librashader-runtime-gl/src/gl/gl3/draw_quad.rs b/librashader-runtime-gl/src/gl/gl3/draw_quad.rs index b2dc603..9ec4785 100644 --- a/librashader-runtime-gl/src/gl/gl3/draw_quad.rs +++ b/librashader-runtime-gl/src/gl/gl3/draw_quad.rs @@ -17,10 +17,8 @@ impl DrawQuad for Gl3DrawQuad { unsafe { vbo = [ - ctx.create_buffer() - .map_err(FilterChainError::GlError)?, - ctx.create_buffer() - .map_err(FilterChainError::GlError)?, + ctx.create_buffer().map_err(FilterChainError::GlError)?, + ctx.create_buffer().map_err(FilterChainError::GlError)?, ]; ctx.bind_buffer(glow::ARRAY_BUFFER, Some(vbo[0])); diff --git a/librashader-runtime-gl/src/gl/gl3/ubo_ring.rs b/librashader-runtime-gl/src/gl/gl3/ubo_ring.rs index e0c3a41..edabc73 100644 --- a/librashader-runtime-gl/src/gl/gl3/ubo_ring.rs +++ b/librashader-runtime-gl/src/gl/gl3/ubo_ring.rs @@ -15,19 +15,14 @@ pub struct Gl3UboRing { impl UboRing for Gl3UboRing { fn new(ctx: &glow::Context, buffer_size: u32) -> error::Result { let items: [glow::Buffer; SIZE] = array_init::try_array_init(|_| unsafe { - ctx - .create_buffer() - .map(|buffer| { - ctx.bind_buffer(glow::UNIFORM_BUFFER, Some(buffer)); - ctx.buffer_data_size( - glow::UNIFORM_BUFFER, - buffer_size as i32, - glow::STREAM_DRAW, - ); - ctx.bind_buffer(glow::UNIFORM_BUFFER, None); - buffer - }) - }).map_err(FilterChainError::GlError)?; + ctx.create_buffer().map(|buffer| { + ctx.bind_buffer(glow::UNIFORM_BUFFER, Some(buffer)); + ctx.buffer_data_size(glow::UNIFORM_BUFFER, buffer_size as i32, glow::STREAM_DRAW); + ctx.bind_buffer(glow::UNIFORM_BUFFER, None); + buffer + }) + }) + .map_err(FilterChainError::GlError)?; let ring: InlineRingBuffer = InlineRingBuffer::from_array(items); Ok(Gl3UboRing { ring }) diff --git a/librashader-runtime-gl/src/gl/gl46/ubo_ring.rs b/librashader-runtime-gl/src/gl/gl46/ubo_ring.rs index c50c95d..9c744d2 100644 --- a/librashader-runtime-gl/src/gl/gl46/ubo_ring.rs +++ b/librashader-runtime-gl/src/gl/gl46/ubo_ring.rs @@ -15,17 +15,12 @@ pub struct Gl46UboRing { impl UboRing for Gl46UboRing { fn new(context: &glow::Context, buffer_size: u32) -> error::Result { let items: [glow::Buffer; SIZE] = array_init::try_array_init(|_| unsafe { - context - .create_named_buffer() - .map(|buffer| { - context.named_buffer_data_size( - buffer, - buffer_size as i32, - glow::STREAM_DRAW, - ); - buffer - }) - }).map_err(FilterChainError::GlError)?; + context.create_named_buffer().map(|buffer| { + context.named_buffer_data_size(buffer, buffer_size as i32, glow::STREAM_DRAW); + buffer + }) + }) + .map_err(FilterChainError::GlError)?; let ring: InlineRingBuffer = InlineRingBuffer::from_array(items); Ok(Gl46UboRing { ring })