Skip to content

Commit

Permalink
Use generic clear_depth
Browse files Browse the repository at this point in the history
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
  • Loading branch information
sagudev committed Oct 13, 2024
1 parent 7a2918d commit 6843f78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ euclid = "0.22"
fnv = { version = "1.0", optional = true }
libc = "0.2"
log = "0.4"
glow = { version = "0.14.2", optional = true }
#glow = { version = "0.14.2", optional = true }
glow = { git = "https://github.com/sagudev/glow", branch = "depth-auto-type", optional = true }
osmesa-sys = { version = "0.1", optional = true }
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = ["std"], optional = true }
rwh_06 = { package = "raw-window-handle", version = "0.6.2", features = ["std"], optional = true }
rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = [
"std",
], optional = true }
rwh_06 = { package = "raw-window-handle", version = "0.6.2", features = [
"std",
], optional = true }

[dev-dependencies]
clap = "2"
Expand Down
4 changes: 2 additions & 2 deletions src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ impl<Device: DeviceAPI> SwapChainData<Device> {
unsafe {
gl.bind_framebuffer(gl::FRAMEBUFFER, fbo);
gl.clear_color(color[0], color[1], color[2], color[3]);
gl.clear_depth_f64(1.);
gl.clear_depth(1.);
gl.clear_stencil(0);
gl.disable(gl::SCISSOR_TEST);
gl.disable(gl::RASTERIZER_DISCARD);
Expand Down Expand Up @@ -435,7 +435,7 @@ impl<Device: DeviceAPI> SwapChainData<Device> {
clear_color[3],
);
gl.color_mask(color_mask[0], color_mask[1], color_mask[2], color_mask[3]);
gl.clear_depth_f64(clear_depth[0] as f64);
gl.clear_depth(clear_depth[0] as f64);
gl.clear_stencil(clear_stencil[0]);
gl.depth_mask(depth_mask);
gl.stencil_mask(stencil_mask[0] as _);
Expand Down

0 comments on commit 6843f78

Please sign in to comment.