Fixing a Firefox Nightly issue in the rain pass.

This commit is contained in:
Rezmason
2021-12-05 22:58:32 -08:00
parent e27c1820cb
commit 9896e2da84
3 changed files with 8 additions and 7 deletions

View File

@@ -2,7 +2,6 @@ TODO:
WebGPU
FF Nightly
var<private> quadCorners : array<vec2<f32>, NUM_VERTICES_PER_QUAD> contained the wrong values
Bloom pass isn't working right
Try https://github.com/brendan-duncan/wgsl_reflect
Get rid of end pass once it's possible to copy a bgra8unorm to a canvas texture

View File

@@ -7,7 +7,7 @@ document.addEventListener("touchmove", (e) => e.preventDefault(), {
});
const supportsWebGPU = async () => {
return window?.GPUQueue?.prototype?.copyExternalImageToTexture != null;
return window.GPUQueue != null;
};
document.body.onload = async () => {

View File

@@ -285,10 +285,11 @@ fn computeResult (isFirstFrame : bool, previousResult : vec4<f32>, glyphPos : ve
// Vertex shader
var<private> quadCorners : array<vec2<f32>, NUM_VERTICES_PER_QUAD> = array<vec2<f32>, NUM_VERTICES_PER_QUAD>(
vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 0.0), vec2<f32>(0.0, 1.0),
vec2<f32>(1.0, 1.0), vec2<f32>(0.0, 1.0), vec2<f32>(1.0, 0.0)
);
// Firefox Nightly (that is to say, Naga) currently has a bug that mixes up these values from ones in the uniforms.
// var<private> quadCorners : array<vec2<f32>, NUM_VERTICES_PER_QUAD> = array<vec2<f32>, NUM_VERTICES_PER_QUAD>(
// vec2<f32>(0.0, 0.0), vec2<f32>(1.0, 0.0), vec2<f32>(0.0, 1.0),
// vec2<f32>(1.0, 1.0), vec2<f32>(0.0, 1.0), vec2<f32>(1.0, 0.0)
// );
[[stage(vertex)]] fn vertMain(input : VertInput) -> VertOutput {
@@ -300,7 +301,8 @@ var<private> quadCorners : array<vec2<f32>, NUM_VERTICES_PER_QUAD> = array<vec2<
var i = i32(input.index);
var quadIndex = i / NUM_VERTICES_PER_QUAD;
var quadCorner = quadCorners[i % NUM_VERTICES_PER_QUAD];
// var quadCorner = quadCorners[i % NUM_VERTICES_PER_QUAD];
var quadCorner = vec2<f32>(f32(i % 2), f32((i + 1) % 6 / 3));
var quadPosition = vec2<f32>(
f32(quadIndex % i32(quadGridSize.x)),