Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ env:
libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev
libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev
libxrandr-dev libxrender-dev libxfixes-dev libxss-dev libxtst-dev libxkbcommon-dev
libglu1-mesa-dev libegl1-mesa-dev mesa-common-dev
libglu1-mesa-dev libegl1-mesa-dev mesa-common-dev libgl1-mesa-dri mesa-utils xvfb
LIBGL_ALWAYS_SOFTWARE: "1"
GALLIUM_DRIVER: "llvmpipe"

jobs:
configure:
Expand All @@ -43,6 +45,8 @@ jobs:
fetch-depth: 0
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Test OpenGL Version
run: xvfb-run glxinfo | grep "OpenGL version"
- name: Configure
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- name: Build SDL
Expand Down Expand Up @@ -75,7 +79,7 @@ jobs:
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON
- run: cmake --build ${{ runner.workspace }}/build --config Debug --target yup_tests
- working-directory: ${{ runner.workspace }}/build/tests/Debug
run: ./yup_tests
run: xvfb-run -a ./yup_tests

build_tests_release:
runs-on: ubuntu-latest
Expand All @@ -96,7 +100,7 @@ jobs:
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON
- run: cmake --build ${{ runner.workspace }}/build --config Release --target yup_tests
- working-directory: ${{ runner.workspace }}/build/tests/Release
run: ./yup_tests
run: xvfb-run -a ./yup_tests

build_console:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ env:
libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev
libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev
libxrandr-dev libxrender-dev libxfixes-dev libxss-dev libxtst-dev libxkbcommon-dev
libglu1-mesa-dev libegl1-mesa-dev mesa-common-dev lcov
libglu1-mesa-dev libegl1-mesa-dev mesa-common-dev libgl1-mesa-dri xvfb lcov
LIBGL_ALWAYS_SOFTWARE: "1"
GALLIUM_DRIVER: "llvmpipe"
IGNORE_ERRORS: "mismatch,gcov,source,negative,unused,empty,format,corrupt"

jobs:
Expand Down Expand Up @@ -94,7 +96,7 @@ jobs:
run: cmake --build . --target coverage_clean
- name: Run C++ Tests
working-directory: ${{ runner.workspace }}/build/tests/Debug
run: SDL_VIDEODRIVER=dummy ./yup_tests --gtest_output=xml:test_results.xml
run: xvfb-run -a ./yup_tests
- name: Generate C++ Coverage Report
working-directory: ${{ runner.workspace }}/build
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

- Added a native WebGPU `GraphicsContext` backend for Emscripten via the Emdawnwebgpu port (`RIVE_WEBGPU=2` + `--use-port=emdawnwebgpu`, enabled with the `ENABLE_EMSCRIPTEN_WEBGPU` parameter of `yup_standalone_app`), rendering Rive content through the browser's WebGPU API without Dawn
- Fixed `GpuFrame::begin()` aborting on the Emscripten WebGPU backend: the WGPU context now creates and submits its own command encoder when no external one is provided, matching the Metal/GL/D3D11 self-managed frame model
- Fixed a crash on Windows when creating any native window: the D3D11 `GpuDevice` was built with an already moved-from `ID3D11Device`, and the Direct3D `GraphicsContext` created a second device whose swapchain textures could not be used by the render context. Both now share a single `ID3D11Device`
- Fixed the Emscripten WebGPU `GraphicsContext` never storing its surface size, leaving the offscreen copy at 0x0

#### Rive Runtime Bump

Expand Down
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ coverage:
project:
default:
informational: true
if_ci_failed: error
target: 80%
threshold: 5%
base: auto
Expand All @@ -30,11 +31,13 @@ coverage:
- yup_graphics
- yup_gui
- yup_python
- yup_rhi
- yup_shading
- yup_simd
patch:
default:
informational: true
if_ci_failed: error
target: 80%
threshold: 5%

Expand All @@ -55,6 +58,7 @@ flags:
yup_graphics: { paths: [modules/yup_graphics/], carryforward: true }
yup_gui: { paths: [modules/yup_gui/], carryforward: true }
yup_python: { paths: [modules/yup_python/], carryforward: true }
yup_rhi: { paths: [modules/yup_rhi/], carryforward: true }
yup_shading: { paths: [modules/yup_shading/], carryforward: true }
yup_simd: { paths: [modules/yup_simd/], carryforward: true }

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ concept guides, walkthroughs, and reference material.
- [Imaging](imaging/index.md) - bitmap images: pixels, loading, saving, and drawing.
- [UI](ui/index.md) - components, windowing, events, layout, and widgets.
- [Audio](audio/index.md) - audio devices, formats, DSP, the audio graph, processors, and plugin hosting/client wrappers.
- [AI](ai/index.md) - the AI and LLM infrastructure.
- [Scripting](scripting/index.md) - the Python bindings layer.

## Quick links
Expand Down
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,12 @@ shader_bundler *COMPILE_ARGS:

rive_update REF="runtime-v0.1.62":
uv run python tools/rive_update.py --rive-ref {{REF}} --allow-dirty --keep-work-dir

rive_shaders_update:
uv venv .venv --clear
source .venv/bin/activate
uv pip install ply
uv run make -C thirdparty/rive_renderer/source/shaders -j 8
cp -R thirdparty/rive_renderer/source/shaders/out/generated/* thirdparty/rive_renderer/source/generated/shaders/
rm -Rf thirdparty/rive_renderer/source/shaders/out
.venv/bin/deactivate
2 changes: 1 addition & 1 deletion modules/yup_graphics/context/yup_GraphicsContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace yup
bool GraphicsContext::isGpuAvailable() const noexcept
{
if (auto device = getGpuDevice())
return device->gpuContext() != nullptr;
return device->getGpuContext() != nullptr;

return false;
}
Expand Down
6 changes: 3 additions & 3 deletions modules/yup_graphics/context/yup_GraphicsContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ class YUP_API GraphicsContext

@return Pointer to a rive::Factory object.
*/
virtual rive::Factory* factory() = 0;
virtual rive::Factory* getFactory() = 0;

/** Gets the PLS render context, if available.

@return Pointer to a rive::pls::PLSRenderContext, or nullptr if not available.
*/
virtual rive::gpu::RenderContext* renderContext() = 0;
virtual rive::gpu::RenderContext* getRenderContext() = 0;

/** Gets the PLS render target, if available.

@return Pointer to a rive::pls::PLSRenderTarget, or nullptr if not available.
*/
virtual rive::gpu::RenderTarget* renderTarget() = 0;
virtual rive::gpu::RenderTarget* getRenderTarget() = 0;

/** Creates a renderer suitable for the specified dimensions.

Expand Down
2 changes: 1 addition & 1 deletion modules/yup_graphics/formats/yup_JpegImageFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ JpegImageFormatReader::JpegImageFormatReader (InputStream* stream, const ImageFo
metadata->rawChunks["jpeg/exif"] = MemoryBlock (data + 6, dataLength - 6);
}
else if (marker->marker == JPEG_APP0 + 1 && dataLength > 29
&& std::memcmp (data, "http://ns.adobe.com/xap/", 29) == 0)
&& std::memcmp (data, "http://ns.adobe.com/xap/1.0/", 29) == 0)
{
if (getOptions().parseRawChunks)
metadata->rawChunks["jpeg/xmp"] = MemoryBlock (data, dataLength);
Expand Down
2 changes: 1 addition & 1 deletion modules/yup_graphics/formats/yup_PngImageFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void PngImageFormatReader::parseChunks()
// tIME chunk
if (std::memcmp (type, "tIME", 4) == 0 && chunkLen >= 7)
{
char buf[20];
char buf[32];
snprintf (buf, sizeof (buf), "%04d:%02d:%02d %02d:%02d:%02d", readBE16 (chunkData), chunkData[2], chunkData[3], chunkData[4], chunkData[5], chunkData[6]);
metadata->textEntries.set ("png/time", String (buf));
}
Expand Down
6 changes: 3 additions & 3 deletions modules/yup_graphics/graphics/yup_Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ rive::Factory* getOffscreenFactory (GraphicsContext& context, RenderableTarget*
if (auto* renderContext = target->getRenderContext())
return renderContext;

return context.factory();
return context.getFactory();
}

std::unique_ptr<rive::Renderer> makeOffscreenRenderer (GraphicsContext& context, RenderableTarget* target, int width, int height)
Expand Down Expand Up @@ -240,7 +240,7 @@ void Graphics::SavedState::restore()
Graphics::Graphics (GraphicsContext& context, rive::Renderer& renderer, float scale) noexcept
: context (context)
, offscreenTarget (nullptr)
, factory (*context.factory())
, factory (*context.getFactory())
, ownedRenderer (nullptr)
, renderer (renderer)
, contextScale (scale)
Expand Down Expand Up @@ -939,7 +939,7 @@ void Graphics::drawTexture (const GpuTexture::Ptr& texture, const Rectangle<floa

bool Graphics::renderTexture (rive::rcp<rive::gpu::Texture> texture, const Rectangle<float>& targetArea)
{
auto renderContext = context.renderContext();
auto renderContext = context.getRenderContext();
if (renderContext == nullptr || texture == nullptr)
return false;

Expand Down
2 changes: 1 addition & 1 deletion modules/yup_graphics/imaging/yup_Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ bool Image::createTextureIfNotPresent (GraphicsContext& context) const
auto width = getWidth();
auto height = getHeight();

auto renderContext = context.renderContext();
auto renderContext = context.getRenderContext();
if (renderContext == nullptr || renderContext->impl() == nullptr)
return false;

Expand Down
6 changes: 3 additions & 3 deletions modules/yup_graphics/imaging/yup_ImagePixelData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ std::vector<uint8> ImagePixelData::toRGBA (bool premultiplyAlpha) const
switch (format)
{
case PixelFormat::Grayscale:
ColorVectorOperations::convertGrayscaleToRGBA (src, result.data(), numPixels);
ColorVectorOperations::convertGrayscaleToRGBA (src, reinterpret_cast<uint32*> (result.data()), numPixels);
break;

case PixelFormat::RGB:
ColorVectorOperations::convertRGBToRGBA (src, result.data(), numPixels);
ColorVectorOperations::convertRGBToRGBA (src, reinterpret_cast<uint32*> (result.data()), numPixels);
break;

case PixelFormat::RGBA:
std::memcpy (result.data(), src, result.size());
if (premultiplyAlpha)
ColorVectorOperations::premultiplyRGBA (result.data(), numPixels);
ColorVectorOperations::premultiplyRGBA (reinterpret_cast<uint32*> (result.data()), numPixels);
break;
}

Expand Down
Loading
Loading