Merge remote-tracking branch 'origin/main' into feat/remove-wasm-bindgen
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/svelte.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<script defer src="https://umami.max-richter.dev/script.js" data-website-id="585c442b-0524-4874-8955-f9853b44b17e"></script>
|
||||
%sveltekit.head%
|
||||
<title>Nodes</title>
|
||||
<script>
|
||||
|
||||
2
app/src/lib/config.ts
Normal file
2
app/src/lib/config.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import { PUBLIC_ANALYTIC_SCRIPT } from "$env/static/public";
|
||||
export const ANALYTIC_SCRIPT = PUBLIC_ANALYTIC_SCRIPT;
|
||||
@@ -64,7 +64,7 @@ export class MemoryRuntimeExecutor implements RuntimeExecutor {
|
||||
|
||||
constructor(
|
||||
private registry: NodeRegistry,
|
||||
private cache?: SyncCache<Int32Array>,
|
||||
public cache?: SyncCache<Int32Array>,
|
||||
) {
|
||||
this.cache = undefined;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,22 @@ const executor = new MemoryRuntimeExecutor(nodeRegistry, cache);
|
||||
const performanceStore = createPerformanceStore();
|
||||
executor.perf = performanceStore;
|
||||
|
||||
export async function setUseRegistryCache(useCache: boolean) {
|
||||
if (useCache) {
|
||||
nodeRegistry.cache = indexDbCache;
|
||||
} else {
|
||||
nodeRegistry.cache = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export async function setUseRuntimeCache(useCache: boolean) {
|
||||
if (useCache) {
|
||||
executor.cache = cache;
|
||||
} else {
|
||||
executor.cache = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export async function executeGraph(
|
||||
graph: Graph,
|
||||
settings: Record<string, unknown>,
|
||||
|
||||
@@ -11,5 +11,11 @@ export class WorkerRuntimeExecutor implements RuntimeExecutor {
|
||||
async getPerformanceData() {
|
||||
return this.worker.getPerformanceData();
|
||||
}
|
||||
set useRuntimeCache(useCache: boolean) {
|
||||
this.worker.setUseRuntimeCache(useCache);
|
||||
}
|
||||
set useRegistryCache(useCache: boolean) {
|
||||
this.worker.setUseRegistryCache(useCache);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,19 @@ export const AppSettingTypes = {
|
||||
label: "Show Graph Source",
|
||||
value: false,
|
||||
},
|
||||
cache: {
|
||||
title: "Cache",
|
||||
useRuntimeCache: {
|
||||
type: "boolean",
|
||||
label: "Node Results",
|
||||
value: true,
|
||||
},
|
||||
useRegistryCache: {
|
||||
type: "boolean",
|
||||
label: "Node Source",
|
||||
value: true,
|
||||
},
|
||||
},
|
||||
stressTest: {
|
||||
title: "Stress Test",
|
||||
amount: {
|
||||
|
||||
@@ -2,7 +2,14 @@
|
||||
import "@nodarium/ui/app.css";
|
||||
import "../app.css";
|
||||
import type { Snippet } from "svelte";
|
||||
import * as config from "$lib/config";
|
||||
const { children } = $props<{ children?: Snippet }>();
|
||||
</script>
|
||||
|
||||
{@render children?.()}
|
||||
|
||||
<svelte:head>
|
||||
{#if config.ANALYTIC_SCRIPT}
|
||||
{@html config.ANALYTIC_SCRIPT}
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
@@ -42,6 +42,25 @@
|
||||
appSettings.value.debug.useWorker ? workerRuntime : memoryRuntime,
|
||||
);
|
||||
|
||||
$effect(() => {
|
||||
workerRuntime.useRegistryCache =
|
||||
appSettings.value.debug.cache.useRuntimeCache;
|
||||
workerRuntime.useRuntimeCache =
|
||||
appSettings.value.debug.cache.useRegistryCache;
|
||||
|
||||
if (appSettings.value.debug.cache.useRegistryCache) {
|
||||
nodeRegistry.cache = registryCache;
|
||||
} else {
|
||||
nodeRegistry.cache = undefined;
|
||||
}
|
||||
|
||||
if (appSettings.value.debug.cache.useRuntimeCache) {
|
||||
memoryRuntime.cache = runtimeCache;
|
||||
} else {
|
||||
memoryRuntime.cache = undefined;
|
||||
}
|
||||
});
|
||||
|
||||
let activeNode = $state<NodeInstance | undefined>(undefined);
|
||||
let scene = $state<Group>(null!);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user