From 7bfc2244d3aed3bf82f35e77cfa22f1759a8b7a5 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 8 Feb 2024 00:20:52 -0800 Subject: [PATCH] gles: fix and build on CI --- .github/workflows/check.yaml | 9 +++++++++ blade-graphics/src/gles/egl.rs | 2 +- blade-render/src/lib.rs | 2 +- src/lib.rs | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index d4100382..ef577758 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -60,6 +60,15 @@ jobs: command: test args: --workspace --all-features + - name: Test GLES + if: matrix.name == 'Linux' + uses: actions-rs/cargo@v1 + with: + command: build + args: --example bunnymark + env: + RUSTFLAGS: "--cfg gles" + fmt: name: Format runs-on: ubuntu-latest diff --git a/blade-graphics/src/gles/egl.rs b/blade-graphics/src/gles/egl.rs index 42fd6c07..30522174 100644 --- a/blade-graphics/src/gles/egl.rs +++ b/blade-graphics/src/gles/egl.rs @@ -737,7 +737,7 @@ impl EglContext { &self, desc: &crate::ContextDesc, ) -> (glow::Context, super::Capabilities, super::Limits) { - let gl = glow::Context::from_loader_function(|name| { + let mut gl = glow::Context::from_loader_function(|name| { self.instance .get_proc_address(name) .map_or(ptr::null(), |p| p as *const _) diff --git a/blade-render/src/lib.rs b/blade-render/src/lib.rs index 4bded363..31f410f2 100644 --- a/blade-render/src/lib.rs +++ b/blade-render/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg(not(target_arch = "wasm32"))] +#![cfg(not(any(gles, target_arch = "wasm32")))] #![allow(irrefutable_let_patterns, clippy::new_without_default)] #![warn( trivial_casts, diff --git a/src/lib.rs b/src/lib.rs index 9d7c5412..ae076aa7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg(not(target_arch = "wasm32"))] +#![cfg(not(any(gles, target_arch = "wasm32")))] #![allow( irrefutable_let_patterns, clippy::new_without_default,