Skip to content

Commit

Permalink
fix: 修复windows环境下shader字符串中的换行符导致shader替换结果错误的bug
Browse files Browse the repository at this point in the history
feat: 更新.eslintrc.js
  • Loading branch information
huyang committed Nov 16, 2023
1 parent fad0dc9 commit 693c49f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
globals: {
"AMap": true,
"L7": true,
'AMap': true,
'L7': true,
},
env: {
browser: true,
Expand All @@ -15,9 +15,9 @@ module.exports = {
ecmaVersion: 12,
sourceType: 'module'
},
plugins: ['@typescript-eslint',"unused-imports"],
plugins: ['@typescript-eslint','unused-imports'],
rules: {
"unused-imports/no-unused-imports": "error",
'unused-imports/no-unused-imports': 'error',
'@typescript-eslint/no-loss-of-precision':0,
'@typescript-eslint/no-inferrable-types': 0,
'no-constant-condition': 0,
Expand All @@ -29,7 +29,8 @@ module.exports = {
'no-useless-catch': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-explicit-any':0,
"@typescript-eslint/no-unused-vars": 0,
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-duplicate-enum-values':0,
'prefer-rest-params':0,
},
settings: {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/services/shader/ShaderModuleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export default class ShaderModuleService implements IShaderModuleService {
// return;
// }

moduleParams.vs = moduleParams.vs.replace(/\r\n/g, '\n'); // 将所有的\r\n替换为\n
moduleParams.fs = moduleParams.fs.replace(/\r\n/g, '\n'); // 将所有的\r\n替换为\n
const { vs, fs, uniforms: declaredUniforms, inject } = moduleParams;
const { content: extractedVS, uniforms: vsUniforms } = extractUniforms(vs);
const { content: extractedFS, uniforms: fsUniforms } = extractUniforms(fs);
Expand Down

0 comments on commit 693c49f

Please sign in to comment.