Minify shaders

This commit is contained in:
redphx
2025-02-08 11:05:52 +07:00
parent b463e4f014
commit bedf82d363
5 changed files with 40 additions and 233 deletions

View File

@@ -1,4 +1,5 @@
import wgslClarityBoost from "./shaders/clarity-boost.wgsl" with { type: "text" };
import { compressCodeFile } from "@macros/build" with { type: "macro" };
import { BaseCanvasPlayer } from "../base-canvas-player";
import { StreamPlayerType } from "@/enums/pref-values";
import { BxEventBus } from "@/utils/bx-event-bus";
@@ -70,7 +71,7 @@ export class WebGPUPlayer extends BaseCanvasPlayer {
]);
this.vertexBuffer.unmap();
const shaderModule = WebGPUPlayer.device.createShaderModule({ code: wgslClarityBoost });
const shaderModule = WebGPUPlayer.device.createShaderModule({ code: compressCodeFile('./src/modules/player/webgpu/shaders/clarity-boost.wgsl') as any as string });
this.pipeline = WebGPUPlayer.device.createRenderPipeline({
layout: 'auto',
vertex: {