Skip to content

More python support - #149

Merged
kunitoki merged 19 commits into
mainfrom
dev/extended_python
Sep 10, 2026
Merged

More python support#149
kunitoki merged 19 commits into
mainfrom
dev/extended_python

Conversation

@kunitoki

@kunitoki kunitoki commented Jul 25, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several important bug fixes and feature enhancements across the GPU/RHI, graphics, and UI subsystems, as well as improvements to Python bindings and memory management. The changes focus on making GPU resource management safer, improving developer ergonomics, fixing subtle memory and correctness bugs, and enhancing Python integration.

Key changes include:

Python Bindings Enhancements

  • Python bindings now expose GpuColor, GpuLoadOp, GpuStoreOp, and related render options, improving scripting and automation capabilities. ([CHANGELOG.mdR111-R112](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR111-R112))

GPU/RHI and Memory Safety Improvements

  • The yup_rhi descriptor classes now own their data instead of referencing caller-managed memory, making GPU resource management safer and simplifying usage patterns. This affects types like GpuVertexBufferLayout, GpuPipelineOptions, GpuShaderSource, and others. ([CHANGELOG.mdR19-R38](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR19-R38))
  • GpuDevice's move constructor and move assignment are now deleted to prevent accidental refcount corruption, addressing a critical memory safety issue. ([CHANGELOG.mdR19-R38](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR19-R38))
  • GpuBuffer::Impl and related methods were made private, with backend factories given friend access, further encapsulating internal implementation details. ([CHANGELOG.mdR19-R38](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR19-R38))

GPU/Graphics Bug Fixes and Feature Additions

  • Fixed several memory and correctness bugs: GpuSamplerDesc::label and GpuTextureDesc::label are now owned Strings to prevent dangling pointers; pipeline entry-point names are now owned, resolving lifetime issues; and the WebGPU compute path now respects shader source length. ([CHANGELOG.mdR57-R65](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR57-R65))
  • Added GpuFrameDescriptor to decouple public APIs from Rive types, and extended GpuCanvas::beginDraw() to allow more control over frame options. ([CHANGELOG.mdR57-R65](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR57-R65))
  • Image::getWidth() and getHeight() now safely return 0 for invalid images instead of asserting, improving robustness. ([CHANGELOG.mdR19-R38](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR19-R38))

Graphics and Image Management

  • ImageFormatReader and ImageFormatWriter now accept a deleteSourceWhenDestroyed parameter, allowing more flexible and leak-free management of stream ownership, especially for Python integrations. ([CHANGELOG.mdR147-R151](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR147-R151))

UI and Exception Safety

  • Fixed a bug where exceptions thrown during painting could leave the graphics frame open, by introducing a scope guard to ensure proper cleanup in SDLComponentNative::renderFrame(). ([CHANGELOG.mdR147-R151](https://github.com/kunitoki/yup/pull/149/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR147-R151))

These changes collectively improve the safety, usability, and extensibility of the codebase, especially around GPU resource management and Python integration.

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.06178% with 482 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.10%. Comparing base (69af3ee) to head (f50cd44).

Files with missing lines Patch % Lines
...s/yup_python/bindings/yup_YupGraphics_bindings.cpp 82.29% 94 Missing ⚠️
...odules/yup_python/bindings/yup_YupGui_bindings.cpp 86.18% 76 Missing ⚠️
modules/yup_python/bindings/yup_YupGui_bindings.h 23.46% 75 Missing ⚠️
...les/yup_python/bindings/yup_YupGraphics_bindings.h 43.51% 61 Missing ⚠️
...odules/yup_python/bindings/yup_YupRhi_bindings.cpp 90.07% 54 Missing ⚠️
...io_formats/sources/yup_AudioFormatReaderSource.cpp 38.59% 35 Missing ⚠️
...dules/yup_python/bindings/yup_YupCore_bindings.cpp 93.82% 20 Missing ⚠️
...p_python/bindings/yup_YupAudioFormats_bindings.cpp 70.31% 19 Missing ⚠️
...p_python/bindings/yup_YupAudioDevices_bindings.cpp 91.55% 13 Missing ⚠️
...yup_python/bindings/yup_YupAudioDevices_bindings.h 0.00% 8 Missing ⚠️
... and 9 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #149      +/-   ##
==========================================
+ Coverage   81.87%   82.10%   +0.22%     
==========================================
  Files         809      818       +9     
  Lines       84867    87399    +2532     
==========================================
+ Hits        69482    71755    +2273     
- Misses      15385    15644     +259     
Files with missing lines Coverage Δ
..._animation/renderer/yup_AnimationFrameExporter.cpp 82.50% <ø> (ø)
...up_animation/renderer/yup_AnimationFrameExporter.h 0.00% <ø> (ø)
...odules/yup_audio_gui/displays/yup_CartesianPlane.h 96.55% <ø> (ø)
modules/yup_core/containers/yup_TypeErasedObject.h 100.00% <100.00%> (ø)
modules/yup_core/network/yup_IPAddress.cpp 95.60% <100.00%> (+2.16%) ⬆️
modules/yup_graphics/graphics/yup_Graphics.cpp 96.21% <100.00%> (+0.02%) ⬆️
modules/yup_graphics/graphics/yup_Graphics.h 100.00% <ø> (ø)
modules/yup_graphics/imaging/yup_Image.cpp 99.17% <100.00%> (-0.02%) ⬇️
modules/yup_graphics/imaging/yup_Image.h 100.00% <ø> (ø)
...dules/yup_graphics/imaging/yup_ImageFormatReader.h 87.50% <ø> (ø)
... and 37 more

... and 25 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69af3ee...f50cd44. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kunitoki
kunitoki force-pushed the dev/extended_python branch from 5392dcd to 1bb5f50 Compare September 7, 2026 00:15
@kunitoki
kunitoki merged commit 97d7da7 into main Sep 10, 2026
41 checks passed
@kunitoki
kunitoki deleted the dev/extended_python branch September 10, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant