Skip to content

Commit

Permalink
swiftlint
Browse files Browse the repository at this point in the history
  • Loading branch information
schwa committed Oct 14, 2024
1 parent db14d4f commit 88b7f8f
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 25 deletions.
1 change: 0 additions & 1 deletion Sources/GaussianSplatSupport/CPUDistanceRadixSort.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ internal struct RadixSortCPU <T> where T: RadixSortable {
// MARK: -

internal extension Collection where Element: BinaryInteger {

@inline(__always) func prefixSumExclusive() -> [Element] {
reduce(into: [0]) { result, value in
result.append(result.last! + value)
Expand Down
2 changes: 1 addition & 1 deletion Sources/GaussianSplatSupport/CPUSorter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal actor CPUSorter <Splat> where Splat: SplatProtocol {
}
indexedDistances.count = splats.count
let end = getMachTime()
// print("XYZZY: \(Measurement(value: end - start, unit: UnitDuration.seconds).converted(to: UnitDuration.milliseconds))")
// print("XYZZY: \(Measurement(value: end - start, unit: UnitDuration.seconds).converted(to: UnitDuration.milliseconds))")
}

private var device: MTLDevice
Expand Down
2 changes: 0 additions & 2 deletions Sources/GaussianSplatSupport/GaussianSplatRenderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import SwiftUI
import Traces

public struct GaussianSplatRenderView <Splat>: View where Splat: SplatProtocol {


@State
private var drawableSize: SIMD2<Float> = .zero

Expand Down
3 changes: 0 additions & 3 deletions Sources/GaussianSplatSupport/GaussianSplatSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import SIMDSupport

// swiftlint:disable force_unwrapping




// MARK: -

internal extension Node {
Expand Down
3 changes: 1 addition & 2 deletions Sources/GaussianSplatSupport/GaussianSplatViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class GaussianSplatViewModel <Splat> where Splat: SplatProtocol {
@ObservationIgnored
public var frame: Int = 0 {
didSet {
// try! sceneChanged()
// try! sceneChanged()
}
}

Expand Down Expand Up @@ -241,7 +241,6 @@ public class GaussianSplatViewModel <Splat> where Splat: SplatProtocol {
return offscreenRenderPassDescriptor
}


private var offscreenRenderPassDescriptor2: MTLRenderPassDescriptor {
guard let resources else {
fatalError("Tried to create renderpass without resources.")
Expand Down
1 change: 0 additions & 1 deletion Sources/MetalSupport/MTLTexture+CoreGraphics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public extension MTLTexture {
return destinationTexture
}


func cgImage(colorSpace: CGColorSpace? = nil) throws -> CGImage {
if let pixelFormat = PixelFormat(pixelFormat) {
let bitmapDefinition = BitmapDefinition(width: width, height: height, pixelFormat: pixelFormat)
Expand Down
1 change: 0 additions & 1 deletion Sources/RenderKit/Renderer/Renderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ struct PassCollection: Equatable {
var renderPasses: [any RenderPassProtocol] {
elements.compactMap { $0 as? any RenderPassProtocol }
}

}

extension CollectionDifference.Change {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public struct GaussianSplatLobbyView: View {
skyboxGradient = .init(stops: [
.init(color: .init(red: 1, green: 0, blue: 0).opacity(0), location: 1),
.init(color: .init(red: 1, green: 0, blue: 0).opacity(1), location: 0)
],
startPoint: .init(x: 0, y: 0),
endPoint: .init(x: 0, y: 1)
],
startPoint: .init(x: 0, y: 0),
endPoint: .init(x: 0, y: 1)
)
}
Button("Go!") {
Expand Down Expand Up @@ -160,10 +160,8 @@ public struct GaussianSplatLobbyView: View {
else {
configuration.skyboxTexture = nil
}

}


@ViewBuilder
var optionsView: some View {
Section("Options") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ internal struct GaussianSplatView: View {
private var gpuCounters

@State
var options: OptionsView.Options = .init()
private var options: OptionsView.Options = .init()

@State
var showOptions: Bool = false
private var showOptions: Bool = false

internal var body: some View {
Group {
Expand All @@ -56,7 +56,7 @@ internal struct GaussianSplatView: View {
.padding()
.popover(isPresented: $showOptions) {
OptionsView(options: $options)
.padding()
.padding()
}
}
.overlay(alignment: .top) {
Expand Down Expand Up @@ -102,7 +102,6 @@ internal struct GaussianSplatView: View {
}

struct OptionsView: View {

struct Options {
var showInfo: Bool = true
var showTraces: Bool = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct LinearGradient: Equatable {

extension LinearGradient {
func shading(size: CGSize) -> GraphicsContext.Shading {
let gradient = Gradient(stops: stops.sorted(by: { $0.location < $1.location }))
let gradient = Gradient(stops: stops.sorted { $0.location < $1.location })
return .linearGradient(gradient, startPoint: CGPoint(x: size.width * startPoint.x, y: size.height * startPoint.y), endPoint: CGPoint(x: size.width * endPoint.x, y: size.height * endPoint.y))
}

Expand All @@ -24,7 +24,7 @@ struct LinearGradientEditor: View {
var value: LinearGradient

@State
var showPopover: Bool = false
private var showPopover: Bool = false

var body: some View {
Button(role: .none) {
Expand Down Expand Up @@ -52,8 +52,8 @@ struct LinearGradientEditor: View {
Section("Stops") {
List($value.stops.indices, id: \.self) { index in
HStack {
ColorPicker("Color \(index+1)", selection: $value.stops[index].color)
TextField("Stop \(index+1)", value: $value.stops[index].location.double, format: .number)
ColorPicker("Color \(index + 1)", selection: $value.stops[index].color)
TextField("Stop \(index + 1)", value: $value.stops[index].location.double, format: .number)
}
.labelsHidden()
}
Expand All @@ -68,7 +68,7 @@ struct LinearGradientEditor: View {
private extension CGFloat {
var double: Double {
get {
return self
self
}
set {
self = newValue
Expand Down

0 comments on commit 88b7f8f

Please sign in to comment.