Skip to content

Commit

Permalink
Merge branch 'feature/ci-asm' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeblanc committed Feb 17, 2024
2 parents 0f1e2e2 + c40422f commit b8338f7
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
compiler_cxx: clang++-15

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install OpenGL dependency
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- build_type: Release
option: default
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install fbx sdk
if: matrix.option != 'no_fbx'
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: wasm
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: emscripten-core/emsdk
path: extern/emsdk
- name: Build
run: |
./build-utils/em-build.sh
- name: Uploads artifacts
uses: actions/upload-artifact@v4
with:
name: samples
path: |
build-wasm/samples/**/*.html
build-wasm/samples/**/*.js
build-wasm/samples/**/*.wasm
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- build_type: Release
option: default
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install fbx sdk
if: matrix.option != 'no_fbx'
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Next release
----------------------

* Build pipeline
- Adds CI for WebAssembly.

Release version 0.14.3
----------------------

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Documentation and samples are available from [ozz-animation website](http://guil
Supported platforms
-------------------

Ozz is tested on Linux, Mac OS and Windows, for x86, x86-64 and ARM architectures. The run-time code (ozz_base, ozz_animation, ozz_geometry) depends only on c++11, on the C and the C++ standard libraries, and has no OS specific code. Portability to any other platform shouldn't be an issue.
ozz-animation is tested on WebAssembly, Linux, macOS and Windows, for x86, x86-64 and ARM architectures. The run-time code (ozz_base, ozz_animation, ozz_geometry) depends only on c++11, on the C and the C++ standard libraries, and has no OS specific code. Portability to any other platform shouldn't be an issue.

Samples, tools and tests depend on external libraries (glfw, tinygltf, Fbx SDK, jsoncpp, gtest, ...), which could limit portability.

Build status
------------

| | Linux | macOS | Windows |
| ------- | ------ | ------ | ------- |
| master | [![Linux](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml/badge.svg?branch=master)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml) | [![macOS](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml/badge.svg?branch=master)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml) | [![Windows](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml/badge.svg?branch=master)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml) |
| develop | [![Linux](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml/badge.svg?branch=develop)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml) | [![macOS](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml/badge.svg?branch=develop)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml) | [![Windows](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml/badge.svg?branch=develop)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml) |
| | Linux | macOS | Windows | WebAssembly |
| ------- | ------ | ------ | ------- | ------- |
| master | [![Linux](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml/badge.svg?branch=master)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml) | [![macOS](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml/badge.svg?branch=master)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml) | [![Windows](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml/badge.svg?branch=master)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml) | [![WASM](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/wasm.yml/badge.svg?branch=master)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/wasm.yml) |
| develop | [![Linux](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml/badge.svg?branch=develop)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/linux.yml) | [![macOS](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml/badge.svg?branch=develop)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/macos.yml) | [![Windows](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml/badge.svg?branch=develop)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/windows.yml) | [![WASM](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/wasm.yml/badge.svg?branch=develop)](https://github.com/guillaumeblanc/ozz-animation/actions/workflows/wasm.yml) |

The dashboard for all branches is available [here](http://guillaumeblanc.github.io/ozz-animation/documentation/dashboard/).

Expand Down
22 changes: 22 additions & 0 deletions build-utils/em-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Setup emscripten
cd extern/emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ../..


# Setup cmake
mkdir build-wasm
cd build-wasm

if [[ $# -eq 0 ]] ; then
emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
else
emcmake cmake -DCMAKE_BUILD_TYPE=$1 ..
fi

# Build
cmake --build .
2 changes: 2 additions & 0 deletions samples/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ add_library(sample_framework STATIC
if(NOT EMSCRIPTEN)
add_subdirectory(${PROJECT_SOURCE_DIR}/extern/glfw glfw)
target_link_libraries(sample_framework glfw)
else()
target_link_options(sample_framework PUBLIC -sUSE_GLFW=2)
endif()

target_link_libraries(sample_framework
Expand Down
2 changes: 1 addition & 1 deletion samples/framework/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Application::LoopStatus Application::OneLoop(int _loops) {
}
#else
int width, height;
if (emscripten_get_canvas_element_size(nullptr, &width, &height) !=
if (emscripten_get_canvas_element_size("#canvas", &width, &height) !=
EMSCRIPTEN_RESULT_SUCCESS) {
return kBreakFailure;
}
Expand Down
3 changes: 2 additions & 1 deletion samples/framework/internal/shader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ ozz::unique_ptr<PointsShader> PointsShader::Build() {
"void main() {\n"
" vec4 vertex = vec4(a_position.xyz, 1.);\n"
" gl_Position = u_mvp * vertex;\n"
" gl_PointSize = a_screen_space == 0. ? a_size / gl_Position.w : a_size;\n"
" gl_PointSize = a_screen_space == 0. ? a_size / gl_Position.w : "
"a_size;\n"
" v_vertex_color = a_color;\n"
"}\n";
const char* kSimplePointsPS =
Expand Down

0 comments on commit b8338f7

Please sign in to comment.