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

Add support for WebGL2 TexStorage2D #26023

Merged
merged 8 commits into from Apr 30, 2020
Next

Add support for WebGL2 TexStorage2D

Adds initial support for the WebGL2 `TexStorage2D` call, adds
support for the related texture enums and enables some of the
texture tests.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6
  • Loading branch information
mmatyas authored and jdm committed Apr 30, 2020
commit 8789a6a8d8186416a766f7ef2a71af217e20f9fb
@@ -1555,7 +1555,7 @@ impl WebGLImpl {
WebGLCommand::TexImage2D {
target,
level,
effective_internal_format,
internal_format,
size,
format,
data_type,
@@ -1567,7 +1567,7 @@ impl WebGLImpl {
ref data,
} => {
let pixels = prepare_pixels(
format,
internal_format,
data_type,
size,
unpacking_alignment,
@@ -1581,7 +1581,7 @@ impl WebGLImpl {
gl.tex_image_2d(
target,
level as i32,
effective_internal_format as i32,
internal_format.as_gl_constant() as i32,
size.width as i32,
size.height as i32,
0,
@@ -1666,6 +1666,23 @@ impl WebGLImpl {
&*data,
);
},
WebGLCommand::TexStorage2D(target, levels, internal_format, width, height) => gl
.tex_storage_2d(
target,
levels as i32,
internal_format.as_gl_constant(),
width as i32,
height as i32,
),
WebGLCommand::TexStorage3D(target, levels, internal_format, width, height, depth) => gl
.tex_storage_3d(
target,
levels as i32,
internal_format.as_gl_constant(),
width as i32,
height as i32,
depth as i32,
),
WebGLCommand::DrawingBufferWidth(ref sender) => {
let size = device
.context_surface_info(&ctx)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.