Skip to content

Commit

Permalink
Allow integer as sampler uniform value (#8586)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed Sep 7, 2022
1 parent db99845 commit d99d149
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/shader/utils/uniformParsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const uniformParsers: IUniformParser[] = [
},
// handling samplers
{
test: (data: any): boolean =>
// eslint-disable-next-line max-len
(data.type === 'sampler2D' || data.type === 'samplerCube' || data.type === 'sampler2DArray') && data.size === 1 && !data.isArray,
test: (data: any, uniform: any): boolean =>
// eslint-disable-next-line max-len,no-eq-null,eqeqeq
(data.type === 'sampler2D' || data.type === 'samplerCube' || data.type === 'sampler2DArray') && data.size === 1 && !data.isArray && (uniform == null || uniform.castToBaseTexture !== undefined),
code: (name: string): string => `t = syncData.textureCount++;
renderer.texture.bind(uv["${name}"], t);
Expand Down

0 comments on commit d99d149

Please sign in to comment.