Skip to content

Commit

Permalink
Fix WASM crash caused by unsupported tex params
Browse files Browse the repository at this point in the history
  • Loading branch information
Speykious committed Jul 16, 2024
1 parent c55799c commit 590cea2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inox2d-opengl/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ impl Texture {
gl.tex_parameter_i32(glow::TEXTURE_2D, glow::TEXTURE_MAG_FILTER, glow::LINEAR as i32);
gl.tex_parameter_i32(glow::TEXTURE_2D, glow::TEXTURE_WRAP_S, glow::CLAMP_TO_BORDER as i32);
gl.tex_parameter_i32(glow::TEXTURE_2D, glow::TEXTURE_WRAP_T, glow::CLAMP_TO_BORDER as i32);

// Texture parameters for f32 slices are not supported on WASM yet.
#[cfg(not(target_arch = "wasm32"))]
gl.tex_parameter_f32_slice(glow::TEXTURE_2D, glow::TEXTURE_BORDER_COLOR, &[0.0; 4]);

gl.tex_image_2d(
glow::TEXTURE_2D,
0,
Expand Down

0 comments on commit 590cea2

Please sign in to comment.