Skip to content

Commit

Permalink
Merge pull request #10113 from minetoblend/filter-program-use-cache
Browse files Browse the repository at this point in the history
Use `GpuProgram.from` in filters
  • Loading branch information
Zyie committed Jan 15, 2024
2 parents 6a770f3 + 714e6d9 commit b7bef21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/filters/blend-modes/BlendModeFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class BlendModeFilter extends Filter

const gpuSource = compileBlendModeShader({ source: blendTemplate, ...gpuOptions });

const gpuProgram = new GpuProgram({
const gpuProgram = GpuProgram.from({
vertex: {
source: gpuSource,
entryPoint: 'mainVertex',
Expand All @@ -43,7 +43,7 @@ export class BlendModeFilter extends Filter

const glSource = compileBlendModeShader({ source: blendTemplateFrag, ...glOptions });

const glProgram = new GlProgram({
const glProgram = GlProgram.from({
vertex: blendTemplateVert,
fragment: glSource
});
Expand Down
4 changes: 2 additions & 2 deletions src/filters/defaults/alpha/AlphaFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class AlphaFilter extends Filter
{
options = { ...AlphaFilter.defaultOptions, ...options };

const gpuProgram = new GpuProgram({
const gpuProgram = GpuProgram.from({
vertex: {
source,
entryPoint: 'mainVertex',
Expand All @@ -56,7 +56,7 @@ export class AlphaFilter extends Filter
},
});

const glProgram = new GlProgram({
const glProgram = GlProgram.from({
vertex,
fragment,
name: 'alpha-filter'
Expand Down
4 changes: 2 additions & 2 deletions src/filters/defaults/noise/NoiseFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class NoiseFilter extends Filter
{
options = { ...NoiseFilter.defaultOptions, ...options };

const gpuProgram = new GpuProgram({
const gpuProgram = GpuProgram.from({
vertex: {
source,
entryPoint: 'mainVertex',
Expand All @@ -51,7 +51,7 @@ export class NoiseFilter extends Filter
},
});

const glProgram = new GlProgram({
const glProgram = GlProgram.from({
vertex,
fragment,
name: 'noise-filter'
Expand Down

0 comments on commit b7bef21

Please sign in to comment.