Skip to content

librashader 0.5.0

Compare
Choose a tag to compare
@chyyran chyyran released this 06 Oct 05:10
· 14 commits to master since this release

Version 0.5.0 has the canonical C ABI version 2, and API version 1.

This is the first release since 0.1.0 with a bump in ABI version, and is thus ABI-incompatible with versions of librashader prior to 0.5.0. Trying to load this version of librashader if the application only supports ABI 1 will fail.

  • If you are an end-user, please use librashader 0.4.5 until the developer has updated their application.
  • If you are a developer, see MIGRATION-ABI2.md on how to update your application to support librashader ABI 2.
  • If you are a package maintainer, you may want to postpone packaging librashader 0.5.0 until relevant applications have been updated. Note that the SONAME for librashader 0.5.0 and above should be librashader.so.2.

ABI 2 cleans up some inconsistencies across runtimes and makes viewport handling much easier and well defined.

Notable Changes

  • #129 cli: add a librashader-cli to interact with shader presets and source code.
    • See CLI.md for more details and usage notes
  • presets: introduce the concept of a "shader pack", which is a JSON-serializable format for packaging a shader preset into a single file.
    • A preset pack includes all required textures and preprocessed shader source files. This is a prerequisite for running librashader on environments without filesystems such as the web.
    • All runtimes support loading from a ShaderPresetPack, which implements Serialize/Deserialize with the serde crate feature.
    • Preset packs can be created with the librashader-cli pack command, but this format should not yet be considered stable.
    • There are no plans for a C API that works with preset packs directly.
  • aeb0a16 vulkan: allow specifying the graphics queue to use
  • OpenGL changes and improvements
    • 1bdadaa opengl: port OpenGL runtime to glow.
      • glow is a platform abstraction layer for OpenGL and is a step towards allowing librashader to run on WebGL.
    • 41353ac opengl: remove need for externally managed FBO for the output image
    • e7fe965 opengl: always ensure framebuffers are bound before rendering
  • #102 Major ABI breaking changes to the C API
    • 1e33b4c capi: make viewport optional and default to a viewport that spans the entire texture
    • 61fdaee capi(opengl): take libra_gl_loader_t in filter chain constructor
    • f18c22a capi(d3d11): take ID3D11ShaderResourceView* directly
    • 7a13136 capi(d3d12): allow passing ID3D12Resource* directly without needing an externally allocated CPU descriptor
  • Direct3D performance optimizations and fixes
    • b0df631 d3d9: load LUTs with BGRA8 ordering rather than ARGB8
    • dbfa822 d3d9: disable alpha blending
    • 7d483f2 d3d9: take viewport IDirect3DSurface9 by reference to avoid AddRef/Release
    • 2fe7702 d3d11: avoid QueryInterface when getting the dimensions of a texture
    • 7b7fd99 d3d11: take viewport ID3D11RenderTargetView by reference to avoid AddRef/Release
    • 3c20c83 d3d12: take D3D12InputImage without changing the refcount
    • 7a13136 d3d12: allow the filter chain to optionally manage input/output descriptors
    • c57e502 d3d12: reduce unnecessary refcount increment/decrement for resources that last the lifetime of the filter chain