Skip to content

Commit 5e7ea4b

Browse files
mvaligurskyMartin Valigursky
andauthored
Improved code formatting of defines for reproject texture shader (#7428)
Co-authored-by: Martin Valigursky <[email protected]>
1 parent 86a0197 commit 5e7ea4b

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/scene/graphics/reproject-texture.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -440,16 +440,17 @@ function reprojectTexture(source, target, options = {}) {
440440

441441
let shader = getProgramLibrary(device).getCachedShader(shaderKey);
442442
if (!shader) {
443-
const defines =
444-
`#define PROCESS_FUNC ${processFunc}\n${
445-
prefilterSamples ? '#define USE_SAMPLES_TEX\n' : ''
446-
}${source.cubemap ? '#define CUBEMAP_SOURCE\n' : ''
447-
}#define DECODE_FUNC ${decodeFunc}\n` +
448-
`#define ENCODE_FUNC ${encodeFunc}\n` +
449-
`#define SOURCE_FUNC ${sourceFunc}\n` +
450-
`#define TARGET_FUNC ${targetFunc}\n` +
451-
`#define NUM_SAMPLES ${numSamples}\n` +
452-
`#define NUM_SAMPLES_SQRT ${Math.round(Math.sqrt(numSamples)).toFixed(1)}\n`;
443+
const defines = `
444+
#define PROCESS_FUNC ${processFunc}
445+
${prefilterSamples ? '#define USE_SAMPLES_TEX' : ''}
446+
${source.cubemap ? '#define CUBEMAP_SOURCE' : ''}
447+
#define DECODE_FUNC ${decodeFunc}
448+
#define ENCODE_FUNC ${encodeFunc}
449+
#define SOURCE_FUNC ${sourceFunc}
450+
#define TARGET_FUNC ${targetFunc}
451+
#define NUM_SAMPLES ${numSamples}
452+
#define NUM_SAMPLES_SQRT ${Math.round(Math.sqrt(numSamples)).toFixed(1)}
453+
`;
453454

454455
shader = createShaderFromCode(
455456
device,

0 commit comments

Comments
 (0)