Skip to content

Commit

Permalink
IE shader compile fix (#4298)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck authored and Donovan Hutchence committed Jun 6, 2022
1 parent f4428ea commit 16b94e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/graphics/program-lib/chunks/common/frag/reproject.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default /* glsl */`
//
// When filtering:
// NUM_SAMPLES - number of samples
// NUM_SAMPLES_SQRT - sqrt of number of samples
//
// SUPPORTS_TEXLOD - whether supports texlod is supported
Expand Down Expand Up @@ -273,11 +274,6 @@ vec4 reproject() {
vec2 sph = toSpherical(TARGET_FUNC());
vec2 sphu = dFdx(sph);
vec2 sphv = dFdy(sph);
// TODO: check this declaration works on old devices.
// might need to be placed globally or be made a #define
const float NUM_SAMPLES_SQRT = sqrt(float(NUM_SAMPLES));
vec3 result = vec3(0.0);
for (float u = 0.0; u < NUM_SAMPLES_SQRT; ++u) {
for (float v = 0.0; v < NUM_SAMPLES_SQRT; ++v) {
Expand Down
1 change: 1 addition & 0 deletions src/graphics/reproject-texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ function reprojectTexture(source, target, options = {}) {
`#define SOURCE_FUNC ${sourceFunc}\n` +
`#define TARGET_FUNC ${targetFunc}\n` +
`#define NUM_SAMPLES ${numSamples}\n` +
`#define NUM_SAMPLES_SQRT ${Math.round(Math.sqrt(numSamples)).toFixed(1)}\n` +
(device.extTextureLod ? `#define SUPPORTS_TEXLOD\n` : '');

let extensions = '';
Expand Down

0 comments on commit 16b94e7

Please sign in to comment.