mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
Fixing a Firefox Nightly issue in the rain pass.
This commit is contained in:
1
TODO.txt
1
TODO.txt
@@ -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
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user