Files
test/source/blender/sequencer/SEQ_preview_cache.hh
Aras Pranckevicius a52bed7786 VSE: Do Scopes on the GPU, improve their look, HDR for waveform/parade
Faster and better looking VSE scopes & "show overexposed". Waveform &
RGB Parade now can also show HDR color intensities. (Note: this is
only about VSE scopes; Image Space scopes are to be improved separately)

- Waveform, RGB Parade, Vectorscope scopes are done on the GPU now, by
  drawing points for each input pixel, and placing them according to
  scope logic. The point drawing is implemented in a compute shader,
  with a fragment shader resolve pass; this is because drawing lots of
  points in the same location is very slow on some GPUs (e.g. Apple).
  The compute shader rasterizer is several times faster on regular
  desktop GPU as well.
- If a non-default color management is needed (e.g. VSE colorspace is
  not the same as display colorspace, or a custom look transform is used
  etc. etc.), then transform the VSE preview texture into display space
  RGBA 16F texture using OCIO GPU machinery, and calculate scopes
  from that.
- The "show overexposed" (zebra) preview option is also done on the
  GPU now.
- Waveform/Parade scopes unlock zoom X/Y aspect for viewing HDR scope,
  similar to how it was done for HDR histograms recently.
- Added SEQ_preview_cache.hh that holds GPU textures of VSE preview,
  this is so that when you have a preview and several scopes, each of
  them does not have to create/upload their own GPU texture (that would
  both waste memory, and be slow).

Screenshots and performance details in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/144867
2025-08-26 12:25:43 +02:00

34 lines
1006 B
C++

/* SPDX-FileCopyrightText: 2025 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup sequencer
*
* Additionally, this holds GPU textures representing the current frame.
* This is to avoid the same GPU texture needing to get re-created if there
* are multiple preview areas open (e.g. with scopes).
*/
#pragma once
struct Scene;
namespace blender::gpu {
class Texture;
}
namespace blender::seq {
gpu::Texture *preview_cache_get_gpu_texture(Scene *scene, int timeline_frame);
void preview_cache_set_gpu_texture(Scene *scene, int timeline_frame, gpu::Texture *texture);
gpu::Texture *preview_cache_get_gpu_display_texture(Scene *scene, int timeline_frame);
void preview_cache_set_gpu_display_texture(Scene *scene,
int timeline_frame,
gpu::Texture *texture);
void preview_cache_invalidate(Scene *scene);
void preview_cache_destroy(Scene *scene);
} // namespace blender::seq