1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins. https://juce.com
Find a file
reuk 9ae52f3d7a Direct2D: Update backbuffer implementation
Problem description
===================

Firstly, the linked-list of pending presentations acted as a stack
(FILO).  If the swap chain thread and main thread processed frames at
varying rates, then the following sequence of events was possible:

Main thread           Swap chain thread       Queue state
---------------------------------------------------------
Push frame (1)                                [1]
Push frame (2)                                [2, 1]
                      Pop frame (2)           [1]
Push frame (3)                                [3, 1]
                      Pop frame (3)           [1]
                      Pop frame (1)           [] <--  Out of sequence!

Secondly, the swap chain's sequential flip model can only maintain a
valid back-buffer state as long as the list of dirty rects is correct,
and every pixel within the dirty rects is painted incrementally.

In the example above, if the main thread were to produce two frames
before the swap chain thread could present any frame, then presenting
*only* the frame 2 (skipping frame 1) may produce incorrect results when
combined with the existing back buffer. This is because regions updated
in frame 1 may not be updated in frame 2, so regions *only* updated in
frame 1 will be omitted from the back buffer.

Mitigation
==========

This patch removes the old stack of presentations and replaces it with a
slightly more complex mechanism that tracks two different Presentation
objects. At any time, up to one Presentation may be in use by the swap
chain thread (i.e. actively presenting), up to one Presentation may be
accumulating updated/dirty regions (i.e. painting), and up to one region
may be ready, awaiting display.

This scheme resolves the first issue described above by ensuring that
old frame data is not kept around. There is never more than one frame
awaiting display, which means that if the swap chain thread attempts to
display twice in a row (before the main thread produces a new frame),
the second attempt will be a no-op.

The second issue is resolved by accumulating changes into a single
Presentation whenever the main thread produces two or more frames in a
row. If there is already a 'ready' Presentation when the main thread
finishes painting, then all updated regions from the newest Presentation
will be added to the 'ready' Presentation, rather than replacing it.
When the swap chain thread is ready to present, it will therefore see
the result of all the accumulated Presentations produced by the main
thread, instead of just the newest Presentation.
2024-06-26 14:33:25 +01:00
.github CLA: Handle commits with no author information 2022-12-21 18:16:58 +00:00
docs WebBrowserComponent: Linux: Add support for libwebkit2gtk-4.1 2024-06-11 20:51:22 +02:00
examples AnimationEasingDemo: Fix shadowing warnings 2024-06-19 16:00:40 +01:00
extras Resave all projects 2024-06-13 07:42:58 +01:00
modules Direct2D: Update backbuffer implementation 2024-06-26 14:33:25 +01:00
.clang-tidy Formatting: Use nested namespace definitions 2023-10-09 14:49:18 +01:00
.gitignore Gitignore: Ignore editorconfig files 2023-10-03 11:08:15 +01:00
.gitlab-ci.yml CI: Update configuration 2024-03-06 21:28:29 +00:00
BREAKING_CHANGES.md VST3: Add support for new wide/Atmos speaker layouts 2024-06-11 11:34:04 +01:00
CHANGE_LIST.md Update change list 2024-06-12 09:35:32 +01:00
CMakeLists.txt Remove outdated copyright years 2024-04-23 12:36:47 +01:00
CODE_OF_CONDUCT.md Add the Contributor Covenant as a code of conduct 2023-09-06 11:24:06 +01:00
LICENSE.md Add CHOC and QuickJS licensing information 2024-05-23 13:41:59 +01:00
README.md Docs: Add AAX signing instructions 2024-05-07 15:19:03 +01:00

alt text

JUCE is an open-source cross-platform C++ application framework for creating desktop and mobile applications, including VST, VST3, AU, AUv3, AAX and LV2 audio plug-ins and plug-in hosts. JUCE can be easily integrated with existing projects via CMake, or can be used as a project generation tool via the Projucer, which supports exporting projects for Xcode (macOS and iOS), Visual Studio, Android Studio, and Linux Makefiles as well as containing a source code editor.

Getting Started

The JUCE repository contains a master and develop branch. The develop branch contains the latest bug fixes and features and is periodically merged into the master branch in stable tagged releases (the latest release containing pre-built binaries can be also downloaded from the JUCE website).

JUCE projects can be managed with either the Projucer (JUCE's own project-configuration tool) or with CMake.

The Projucer

The repository doesn't contain a pre-built Projucer so you will need to build it for your platform - Xcode, Visual Studio and Linux Makefile projects are located in extras/Projucer/Builds (the minimum system requirements are listed in the minimum system requirements section below). The Projucer can then be used to create new JUCE projects, view tutorials and run examples. It is also possible to include the JUCE modules source code in an existing project directly, or build them into a static or dynamic library which can be linked into a project.

For further help getting started, please refer to the JUCE documentation and tutorials.

CMake

Version 3.22 or higher is required. To use CMake, you will need to install it, either from your system package manager or from the official download page. For comprehensive documentation on JUCE's CMake API, see the JUCE CMake documentation. For examples which may be useful as starting points for new CMake projects, see the CMake examples directory.

Building Examples

To use CMake to build the examples and extras bundled with JUCE, simply clone JUCE and then run the following commands, replacing "DemoRunner" with the name of the target you wish to build.

cd /path/to/JUCE
cmake . -B cmake-build -DJUCE_BUILD_EXAMPLES=ON -DJUCE_BUILD_EXTRAS=ON
cmake --build cmake-build --target DemoRunner

Minimum System Requirements

Building JUCE Projects

  • C++ Standard: 17
  • macOS/iOS: Xcode 12.4 (Intel macOS 10.15.4, Apple Silicon macOS 11.0)
  • Windows: Visual Studio 2019 (Windows 10)
  • Linux: g++ 7.0 or Clang 6.0 (for a full list of dependencies, see here).
  • Android: Android Studio (NDK 26) on Windows, macOS or Linux

Deployment Targets

  • macOS: macOS 10.11
  • Windows: Windows 10
  • Linux: Mainstream Linux distributions
  • iOS: iOS 12
  • Android: Android 5 - Lollipop (API Level 21)

Contributing

Please see our contribution guidelines.

Licensing

See LICENSE.md for licensing and dependency information.

AAX Plug-Ins

AAX plug-ins need to be digitally signed using PACE Anti-Piracy's signing tools before they will run in commercially available versions of Pro Tools. These tools are provided free of charge by Avid. Before obtaining the signing tools, you will need to use a special build of Pro Tools, called Pro Tools Developer, to test your unsigned plug-ins. The steps to obtain Pro Tools Developer are:

  1. Sign up as an AAX Developer here.
  2. Request a Pro Tools Developer Bundle activation code by sending an email to devauth@avid.com.
  3. Download the latest Pro Tools Developer build from your Avid Developer account.

When your plug-ins have been tested and debugged in Pro Tools Developer, and you are ready to digitally sign them, please send an email to audiosdk@avid.com with the subject "PACE Eden Signing Tools Request". You need to include an overview of each plug-in along with a screen recording showing the plug-in running in Pro Tools Developer, with audio if possible.

Please also include the following information:

  • Company name
  • Admin full name
  • Telephone number

Once the request is submitted, PACE Anti-Piracy will contact you directly with information about signing your plug-ins. When the plug-ins have been signed, you are free to sell and distribute them. If you are interested in selling your plug-ins on the Avid Marketplace, please send an email to audiosdk@avid.com.