Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conformance/rendering/blending for WebGL 1.0 #3671

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions sdk/tests/conformance/rendering/blending.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,9 @@
continue;
}
if (f.length == 3) {
let internalFormat = f[0];
if (internalFormat === undefined) {
internalFormat = f[1];
}

const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1,1,0, f[1],f[2], null);
gl.texImage2D(gl.TEXTURE_2D, 0, f[0], 1, 1, 0, f[1], f[2], null);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0+i,
gl.TEXTURE_2D, tex, 0);
continue;
Expand Down Expand Up @@ -146,7 +141,8 @@
debug('Blending for RGBA8:');

const gl = CreateContext();
fb = CreateValidFb(gl, [[gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE]]);
// Do not use RGBA8 enum on WebGL 1.0
fb = CreateValidFb(gl, [[gl.texImage3D ? gl.RGBA8 : gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE]]);
shouldBeNonNull('fb');

// Regardless of the context version and enabled extensions,
Expand Down Expand Up @@ -183,7 +179,8 @@
gl.HALF_FLOAT = ext.HALF_FLOAT_OES; // These aren't the same value, but this'll work.
}

fb = CreateValidFb(gl, [[gl.RGBA16F, gl.RGBA, gl.HALF_FLOAT]]);
// Do not use RGBA16F enum on WebGL 1.0
fb = CreateValidFb(gl, [[gl.texImage3D ? gl.RGBA16F : gl.RGBA, gl.RGBA, gl.HALF_FLOAT]]);
shouldBeNonNull('fb');
gl.prog.uColor([1, 2, 3, 4]);

Expand Down Expand Up @@ -223,7 +220,8 @@
}
gl.getExtension('OES_texture_float');
}
fb = CreateValidFb(gl, [[gl.RGBA32F, gl.RGBA, gl.FLOAT]]);
// Do not use RGBA32F enum on WebGL 1.0
fb = CreateValidFb(gl, [[gl.texImage3D ? gl.RGBA32F : gl.RGBA, gl.RGBA, gl.FLOAT]]);
shouldBeNonNull('fb');
gl.prog.uColor([1, 2, 3, 4]);

Expand Down
Loading