MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / getStageModule

Function getStageModule

src/renderers/rendererUtils.ts:87–104  ·  view source on GitHub ↗
(
  device: GPUDevice,
  stage: ShaderStageModuleSource
)

Source from the content-addressed store, hash-verified

85};
86
87const getStageModule = (
88 device: GPUDevice,
89 stage: ShaderStageModuleSource
90): { readonly module: GPUShaderModule; readonly entryPoint: string; readonly constants?: Record<string, GPUPipelineConstantValue> } => {
91 if ('module' in stage) {
92 return {
93 module: stage.module,
94 entryPoint: stage.entryPoint || '',
95 constants: stage.constants,
96 };
97 }
98
99 return {
100 module: createShaderModule(device, stage.code, stage.label),
101 entryPoint: stage.entryPoint || '',
102 constants: stage.constants,
103 };
104};
105
106/**
107 * Creates a shader module from WGSL source.

Callers 1

createRenderPipelineFunction · 0.85

Calls 1

createShaderModuleFunction · 0.85

Tested by

no test coverage detected