Skip to content

Commit ce7d9d4

Browse files
committed
Remove composite pipeline prewarm and update types
1 parent 555c998 commit ce7d9d4

3 files changed

Lines changed: 4 additions & 34 deletions

File tree

apps/desktop/src-tauri/src/gpu_context.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,6 @@ pub async fn get_shared_gpu() -> Option<&'static SharedGpuContext> {
158158

159159
pub fn prewarm_gpu() {
160160
tokio::spawn(async {
161-
let gpu = get_shared_gpu().await;
162-
if let Some(gpu) = gpu {
163-
let device = gpu.device.clone();
164-
std::thread::Builder::new()
165-
.name("pipeline-prewarm".into())
166-
.spawn(move || {
167-
cap_rendering::prewarm_composite_pipeline(&device);
168-
})
169-
.ok();
170-
}
161+
get_shared_gpu().await;
171162
});
172163
}

apps/desktop/src/utils/tauri.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ videoImportProgress: "video-import-progress"
403403

404404
/** user-defined types **/
405405

406-
export type AllGpusInfo = { gpus: GpuInfoDiag[]; primaryGpuIndex: number | null; isMultiGpuSystem: boolean; hasDiscreteGpu: boolean }
407406
export type Annotation = { id: string; type: AnnotationType; x: number; y: number; width: number; height: number; strokeColor: string; strokeWidth: number; fillColor: string; opacity: number; rotation: number; text: string | null; maskType?: MaskType | null; maskLevel?: number | null }
408407
export type AnnotationType = "arrow" | "circle" | "rectangle" | "text" | "mask"
409408
export type AppTheme = "system" | "light" | "dark"
@@ -477,7 +476,6 @@ quality: number | null;
477476
*/
478477
fast: boolean | null }
479478
export type GlideDirection = "none" | "left" | "right" | "up" | "down"
480-
export type GpuInfoDiag = { vendor: string; description: string; dedicatedVideoMemoryMb: number; adapterIndex: number; isSoftwareAdapter: boolean; isBasicRenderDriver: boolean; supportsHardwareEncoding: boolean }
481479
export type HapticPattern = "alignment" | "levelChange" | "generic"
482480
export type HapticPerformanceTime = "default" | "now" | "drawCompleted"
483481
export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }
@@ -491,6 +489,7 @@ export type JsonValue<T> = [T]
491489
export type LogicalBounds = { position: LogicalPosition; size: LogicalSize }
492490
export type LogicalPosition = { x: number; y: number }
493491
export type LogicalSize = { width: number; height: number }
492+
export type MacOSVersionInfo = { major: number; minor: number; patch: number; displayName: string; buildNumber: string; isAppleSilicon: boolean }
494493
export type MainWindowRecordingStartBehaviour = "close" | "minimise"
495494
export type MaskKeyframes = { position?: MaskVectorKeyframe[]; size?: MaskVectorKeyframe[]; intensity?: MaskScalarKeyframe[] }
496495
export type MaskKind = "sensitive" | "highlight"
@@ -534,7 +533,6 @@ export type RecordingStatus = "pending" | "recording"
534533
export type RecordingStopped = null
535534
export type RecordingTargetMode = "display" | "window" | "area" | "camera"
536535
export type RenderFrameEvent = { frame_number: number; fps: number; resolution_base: XY<number> }
537-
export type RenderingStatus = { isUsingSoftwareRendering: boolean; isUsingBasicRenderDriver: boolean; hardwareEncodingAvailable: boolean; warningMessage: string | null }
538536
export type RequestOpenRecordingPicker = { target_mode: RecordingTargetMode | null }
539537
export type RequestOpenSettings = { page: string }
540538
export type RequestScreenCapturePrewarm = { force?: boolean }
@@ -557,7 +555,7 @@ export type StartRecordingInputs = { capture_target: ScreenCaptureTarget; captur
557555
export type StereoMode = "stereo" | "monoL" | "monoR"
558556
export type StudioRecordingMeta = { segment: SingleSegment } | { inner: MultipleSegments }
559557
export type StudioRecordingStatus = { status: "InProgress" } | { status: "NeedsRemux" } | { status: "Failed"; error: string } | { status: "Complete" }
560-
export type SystemDiagnostics = { windowsVersion: WindowsVersionInfo | null; gpuInfo: GpuInfoDiag | null; allGpus: AllGpusInfo | null; renderingStatus: RenderingStatus; availableEncoders: string[]; graphicsCaptureSupported: boolean; d3D11VideoProcessorAvailable: boolean }
558+
export type SystemDiagnostics = { macosVersion: MacOSVersionInfo | null; availableEncoders: string[]; screenCaptureSupported: boolean; metalSupported: boolean; gpuName: string | null }
561559
export type TargetUnderCursor = { display_id: DisplayId | null; window: WindowUnderCursor | null }
562560
export type TextSegment = { start: number; end: number; enabled?: boolean; content?: string; center?: XY<number>; size?: XY<number>; fontFamily?: string; fontSize?: number; fontWeight?: number; italic?: boolean; color?: string; fadeDuration?: number }
563561
export type TimelineConfiguration = { segments: TimelineSegment[]; zoomSegments: ZoomSegment[]; sceneSegments?: SceneSegment[]; maskSegments?: MaskSegment[]; textSegments?: TextSegment[] }
@@ -576,7 +574,6 @@ export type WindowExclusion = { bundleIdentifier?: string | null; ownerName?: st
576574
export type WindowId = string
577575
export type WindowPosition = { x: number; y: number; displayId?: DisplayId | null }
578576
export type WindowUnderCursor = { id: WindowId; app_name: string; bounds: LogicalBounds }
579-
export type WindowsVersionInfo = { major: number; minor: number; build: number; displayName: string; meetsRequirements: boolean; isWindows11: boolean }
580577
export type XY<T> = { x: T; y: T }
581578
export type ZoomMode = "auto" | { manual: { x: number; y: number } }
582579
export type ZoomSegment = { start: number; end: number; amount: number; mode: ZoomMode; glideDirection?: GlideDirection; glideSpeed?: number; instantAnimation?: boolean; edgeSnapRatio?: number }

crates/rendering/src/lib.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,6 @@ use std::{collections::HashMap, sync::Arc};
2020
use std::{path::PathBuf, time::Instant};
2121
use tokio::sync::mpsc;
2222

23-
static PRECOMPILED_COMPOSITE_PIPELINE: std::sync::OnceLock<
24-
Arc<composite_frame::CompositeVideoFramePipeline>,
25-
> = std::sync::OnceLock::new();
26-
27-
pub fn prewarm_composite_pipeline(device: &wgpu::Device) {
28-
let pipeline = composite_frame::CompositeVideoFramePipeline::new(device);
29-
let _ = PRECOMPILED_COMPOSITE_PIPELINE.set(Arc::new(pipeline));
30-
}
31-
32-
pub fn get_precompiled_composite_pipeline()
33-
-> Option<Arc<composite_frame::CompositeVideoFramePipeline>> {
34-
PRECOMPILED_COMPOSITE_PIPELINE.get().cloned()
35-
}
36-
3723
pub mod composite_frame;
3824
mod coord;
3925
pub mod cpu_yuv;
@@ -2521,11 +2507,7 @@ impl RendererLayers {
25212507
) -> Self {
25222508
let shared_yuv_pipelines = Arc::new(yuv_converter::YuvConverterPipelines::new(device));
25232509
let shared_composite_pipeline =
2524-
if let Some(precompiled) = get_precompiled_composite_pipeline() {
2525-
precompiled
2526-
} else {
2527-
Arc::new(composite_frame::CompositeVideoFramePipeline::new(device))
2528-
};
2510+
Arc::new(composite_frame::CompositeVideoFramePipeline::new(device));
25292511

25302512
Self {
25312513
background: BackgroundLayer::new(device),

0 commit comments

Comments
 (0)