style: apply nightly rustfmt import grouping across the workspace
rustfmt.toml sets group_imports, imports_granularity and imports_layout, which are nightly-only; agents formatted with stable rustfmt, which ignored them. This is a formatting-only pass with `cargo +nightly fmt`. Test Plan: - cargo clippy --workspace --all-targets -- -D warnings - cargo test --workspace
This commit is contained in:
1 parent
81d4119d85
commit
8bcb85a29a
259 files changed
+2495
-1547
No files matched your search
@@ -1,9 +1,11 @@
|
||||
//! Wrapper for handling render frames (`opengl/Frame.zig`).
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::OpenGL;
|
||||
use super::render_pass::{Attachment, Options as RenderPassOptions, RenderPass};
|
||||
use super::target::Target;
|
||||
use super::{
|
||||
OpenGL,
|
||||
render_pass::{Attachment, Options as RenderPassOptions, RenderPass},
|
||||
target::Target,
|
||||
};
|
||||
use crate::backend::Health;
|
||||
|
||||
/// Options for beginning a frame.
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
//! * Pointer-carrying calls (`buffer_data`, `tex_image_2d`, ...) are only given
|
||||
//! Rust slices, so lengths are always valid for the pointed memory.
|
||||
|
||||
use std::ffi::c_void;
|
||||
use std::sync::Arc;
|
||||
use std::{ffi::c_void, sync::Arc};
|
||||
|
||||
use glow::HasContext;
|
||||
|
||||
@@ -57,8 +56,12 @@ impl std::fmt::Debug for Gl {
|
||||
|
||||
// Re-exported raw handle types.
|
||||
pub use glow::{
|
||||
Buffer as RawBuffer, Framebuffer as RawFramebuffer, Program as RawProgram,
|
||||
Renderbuffer as RawRenderbuffer, Sampler as RawSampler, Texture as RawTexture,
|
||||
Buffer as RawBuffer,
|
||||
Framebuffer as RawFramebuffer,
|
||||
Program as RawProgram,
|
||||
Renderbuffer as RawRenderbuffer,
|
||||
Sampler as RawSampler,
|
||||
Texture as RawTexture,
|
||||
VertexArray as RawVertexArray,
|
||||
};
|
||||
|
||||
|
||||
@@ -16,23 +16,31 @@ pub mod shaders;
|
||||
pub mod target;
|
||||
pub mod texture;
|
||||
|
||||
use std::ffi::c_void;
|
||||
use std::sync::Arc;
|
||||
use std::{ffi::c_void, sync::Arc};
|
||||
|
||||
use ghostty_font::atlas::{Atlas, Format as AtlasFormat};
|
||||
|
||||
pub use self::buffer::Buffer;
|
||||
pub use self::frame::Frame;
|
||||
pub use self::gl::Gl;
|
||||
use self::gl::{
|
||||
BufferTarget, BufferUsage, FramebufferTarget, InternalFormat, MagFilter, MinFilter,
|
||||
PixelFormat, TextureTarget, Wrap,
|
||||
BufferTarget,
|
||||
BufferUsage,
|
||||
FramebufferTarget,
|
||||
InternalFormat,
|
||||
MagFilter,
|
||||
MinFilter,
|
||||
PixelFormat,
|
||||
TextureTarget,
|
||||
Wrap,
|
||||
};
|
||||
pub use self::{
|
||||
buffer::Buffer,
|
||||
frame::Frame,
|
||||
gl::Gl,
|
||||
pipeline::Pipeline,
|
||||
render_pass::RenderPass,
|
||||
sampler::Sampler,
|
||||
target::Target,
|
||||
texture::Texture,
|
||||
};
|
||||
pub use self::pipeline::Pipeline;
|
||||
pub use self::render_pass::RenderPass;
|
||||
pub use self::sampler::Sampler;
|
||||
pub use self::target::Target;
|
||||
pub use self::texture::Texture;
|
||||
use crate::shadertoy;
|
||||
|
||||
pub type GraphicsApi = OpenGL;
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
//! Wrapper for handling render pipelines (`opengl/Pipeline.zig`).
|
||||
use super::gl::{
|
||||
self, AttribType, FramebufferTarget, Gl, RawFramebuffer, RawProgram, RawVertexArray,
|
||||
self,
|
||||
AttribType,
|
||||
FramebufferTarget,
|
||||
Gl,
|
||||
RawFramebuffer,
|
||||
RawProgram,
|
||||
RawVertexArray,
|
||||
};
|
||||
|
||||
/// Vertex step function.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//! Wrapper for handling render passes (`opengl/RenderPass.zig`).
|
||||
use super::gl::{
|
||||
Attachment as GlAttachment, BufferTarget, FramebufferTarget, Gl, Primitive, RawBuffer,
|
||||
use super::{
|
||||
gl::{Attachment as GlAttachment, BufferTarget, FramebufferTarget, Gl, Primitive, RawBuffer},
|
||||
pipeline::Pipeline,
|
||||
sampler::Sampler,
|
||||
target::Target,
|
||||
texture::Texture,
|
||||
};
|
||||
use super::pipeline::Pipeline;
|
||||
use super::sampler::Sampler;
|
||||
use super::target::Target;
|
||||
use super::texture::Texture;
|
||||
|
||||
/// What a color attachment renders into.
|
||||
pub enum AttachmentTarget<'a> {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
//! Shader pipelines and GPU data layouts for OpenGL (`opengl/shaders.zig`).
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
|
||||
use super::gl::{self, AttribType, Gl};
|
||||
use super::pipeline::{Attribute, Options as PipelineOptions, Pipeline, StepFunction, Vertex};
|
||||
use super::{
|
||||
gl::{self, AttribType, Gl},
|
||||
pipeline::{Attribute, Options as PipelineOptions, Pipeline, StepFunction, Vertex},
|
||||
};
|
||||
use crate::math::Mat;
|
||||
|
||||
/// `shaders/glsl/common.glsl`, the only `#include`d file.
|
||||
@@ -464,9 +466,10 @@ impl Vertex for BgImage {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use core::mem::{offset_of, size_of};
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn uniforms_std140_layout() {
|
||||
// Offsets from the std140 rules applied to the `Globals` block in
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
//!
|
||||
//! In this case, an OpenGL renderbuffer-backed framebuffer.
|
||||
use super::gl::{
|
||||
self, Attachment, FramebufferTarget, Gl, InternalFormat, RawFramebuffer, RawRenderbuffer,
|
||||
self,
|
||||
Attachment,
|
||||
FramebufferTarget,
|
||||
Gl,
|
||||
InternalFormat,
|
||||
RawFramebuffer,
|
||||
RawRenderbuffer,
|
||||
};
|
||||
|
||||
/// Options for initializing a Target
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
//! Wrapper for handling textures (`opengl/Texture.zig`).
|
||||
use super::gl::{
|
||||
self, Gl, InternalFormat, MagFilter, MinFilter, PixelFormat, RawTexture, TextureTarget, Wrap,
|
||||
self,
|
||||
Gl,
|
||||
InternalFormat,
|
||||
MagFilter,
|
||||
MinFilter,
|
||||
PixelFormat,
|
||||
RawTexture,
|
||||
TextureTarget,
|
||||
Wrap,
|
||||
};
|
||||
|
||||
/// Options for initializing a texture.
|
||||
|
||||
Reference in new issue
Block a user