ACMX 2.136.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
acmx.cpp File Reference

ACMX2 — Real-time GPU-accelerated video glitch engine. More...

#include "mxwrite.hpp"
#include "shader_selection_shm.hpp"
#include "version_info.hpp"
#include <algorithm>
#include <argz.hpp>
#include <atomic>
#include <cctype>
#include <chrono>
#include <cmath>
#include <condition_variable>
#include <csignal>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <filesystem>
#include <fstream>
#include <functional>
#include <gl.hpp>
#include <iomanip>
#include <limits>
#include <map>
#include <mutex>
#include <mx.hpp>
#include <opencv2/opencv.hpp>
#include <optional>
#include <queue>
#include <random>
#include <regex>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <unordered_map>
#include <vector>
#include "audio.hpp"
#include "file_audio.hpp"
#include <rtmidi/RtMidi.h>
#include "program.hpp"
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/hwcontext.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <model.hpp>
#include <string_view>

Go to the source code of this file.

Classes

class  ACView
 Core rendering object—drives the capture → filter → shade → record pipeline. More...
struct  anonymous_namespace{acmx.cpp}::CliColors
struct  ShaderManifestData::CustomUniform
struct  ac_gpu::DynamicFrameBuffer
class  FFMpegVideoReader
struct  ac_gpu::Filter
class  FrameCache
 Fixed-capacity ring buffer of GL textures for temporal shaders. More...
struct  FrameData
 A captured RGBA pixel buffer queued for the writer thread. More...
struct  ac_gpu::GPUFilter
struct  anonymous_namespace{acmx.cpp}::HelpEntry
class  MainWindow
 Primary ACMX desktop UI. More...
struct  ACView::MidiCode
struct  MXArguments
 Parsed command-line arguments for the ACMX2 application. More...
struct  OpenGLContextConfig
struct  ACView::PlaylistNode
struct  ShaderLibrary::ProgramData
 Cached uniform locations for a single compiled shader program. More...
struct  ShaderCache
 Container for the full on-disk shader cache file. More...
struct  ShaderCacheEntry
 One shader's precompiled binary data for the on-disk cache. More...
class  ShaderLibrary
 Manages the complete collection of compiled GLSL shader programs. More...
struct  ShaderManifestData
class  SnapshotThreadPool
 A fixed-size thread pool used for writing PNG snapshots asynchronously. More...
class  SpectrumHistory
 Runtime-sized ring buffer stored in one 1D array texture. More...
class  SpectrumTexture
 Manages a 1D OpenGL texture that holds the FFT frequency-magnitude spectrum. More...
class  TextureUploader
 Host-zero-copy CUDA-to-OpenGL texture transfer via direct image interop. More...

Namespaces

namespace  ac_gpu
namespace  anonymous_namespace{acmx.cpp}

Macros

#define CHECK_CUDA(call)

Typedefs

typedef GLsizei GLsizei GLenum voidbinary
typedef GLsizei GLsizei GLenum * binaryFormat
typedef GLsizei bufSize
typedef GLsizei GLsizei * length

Enumerations

enum class  FrameRotation { None , Clockwise90 , Rotate180 , Counterclockwise90 }
enum class  ShaderManifestFormat { Json , Text }
enum class  ShaderProgramKind { Fragment , Compute , ComputeUnavailable }

Functions

void checkDevices (bool list_only=false)
 Verify CUDA device availability and print GPU info.
float clamp01f (float v)
static bool collectShaderLibraryEntries (const std::string &library_path, std::vector< std::string > &shader_files, std::string &error)
bool convertBt2020Yuv10LimitedToRgba16 (const AVFrame *src, cv::Mat &out)
static std::filesystem::path executable_directory ()
 Return the directory containing the running ACMX2 executable.
float hlgToLinearScalar (float e)
static std::filesystem::path installed_assets_directory ()
 Locate the installed ACMX2 asset root relative to the executable.
void anonymous_namespace{acmx.cpp}::installHeadlessSignalHandlers ()
static bool isComputeShaderFile (const std::string &path)
static bool isEditorPreviewForShader (const std::filesystem::path &loaded_shader, const std::filesystem::path &requested_path)
static bool isEditorPreviewPath (const std::filesystem::path &library_path, const std::filesystem::path &requested_path)
static bool isValidCustomUniformName (const std::string &name)
uint16_t linearToSrgb16 (float v)
unsigned char linearToSrgb8 (float v)
bool loadProgramBinaryFunctions ()
 Dynamically load glGetProgramBinary / glProgramBinary via SDL.
static bool loadShaderManifest (const std::string &library_path, ShaderManifestData &manifest, std::string &error)
int main (int argc, char **argv)
 Application entry point.
CliColors anonymous_namespace{acmx.cpp}::makeCliColors ()
static std::optional< std::string > normalizeShaderIndexEntry (const std::string &raw)
float pqToLinearScalar (float e)
static void print_open_gl_uniform_limits ()
 Print the active driver's shader-uniform capacity in one line.
void printAbout (bool include_branding=true)
 Print program information, arguments, and keyboard controls.
void printBranding ()
 Print the program name, software brand, and project URL once.
template<typename Stream>
void anonymous_namespace{acmx.cpp}::printDetailedArguments (Stream &out)
template<typename Stream>
void anonymous_namespace{acmx.cpp}::printKeyboardControls (Stream &out)
template<typename Stream>
void anonymous_namespace{acmx.cpp}::printSection (Stream &out, const CliColors &c, std::string_view name, const std::vector< HelpEntry > &entries)
static std::optional< cv::Size > probe_video_size (const std::string &filename)
 Read a video's coded dimensions without opening a decoder.
static bool resolveShaderPathInLibrary (const std::string &library_path, const std::string &relative_path, std::string &resolved_full_path)
static std::string safeGLString (GLenum name)
static OpenGLContextConfig select_open_gl_context ()
static bool set_environment_if_missing (const char *name, const char *value)
static int shaderIndexForFile (const std::vector< std::string > &shader_files, const std::string &shader_file)
static std::string shaderManifestPath (const std::string &library_path)
static std::vector< std::string > sortedShaderLibraryEntries (const std::string &library_path)
bool anonymous_namespace{acmx.cpp}::terminalSupportsColor ()
std::vector< unsigned char > toneMapHdrRgba16ToSdrRgba8 (const std::vector< unsigned char > &hdr_pixels, int w, int h, int hdr_trc)
std::vector< uint16_t > toneMapHdrRgba16ToSrgbRgba16 (const unsigned char *hdr_pixels, int w, int h, int hdr_trc)
void transfer_audio (std::string_view, std::string_view)
 Copy the audio track from one media file to another via FFmpeg.
static void update_compute_shader_support ()
 Update the feature flag from the real context rather than only the probe.
typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC_LOCAL)(GLuint program
static bool writeJsonShaderManifest (const std::string &path, const std::vector< std::string > &entries, const std::vector< ShaderManifestData::CustomUniform > &custom_uniforms, std::string &error)

Variables

constexpr int ac_gpu::AC_FILTER_MAX = 0
static bool compute_shader_supported = false
 True when the active ACMX2 context can run OpenGL compute shaders.
constexpr std::size_t FFT_SIZE
Filter ac_gpu::filters [1] = {{0, ""}}
std::atomic< bool > anonymous_namespace{acmx.cpp}::g_shutdown_requested {false}
static PFNGLGETPROGRAMBINARYPROC_LOCAL glGetProgramBinaryFunc = nullptr
static PFNGLPROGRAMBINARYPROC_LOCAL glProgramBinaryFunc = nullptr
constexpr const char * kDisplayFragPassthrough
constexpr const char * kDisplayVertFlip
constexpr const char * kHdrDecodeFrag
constexpr const char * kHdrEncodeFrag
constexpr const char * kHdrVertPassthrough
constexpr const char * kMuxOverlayFrag

Detailed Description

ACMX2 — Real-time GPU-accelerated video glitch engine.

This file implements the complete ACMX2 command-line application, the core engine of the acidcam-gpu project. It combines CUDA GPU filters, GLSL shader processing, OpenGL rendering, optional 3D model support, audio reactivity, MIDI controller input, and video recording into a single real-time pipeline.

Architecture Overview

  • TextureUploader — Host-zero-copy CUDA↔OpenGL image interop (direct cudaArray binding) for GPU frames.
  • ShaderCache / ShaderLibrary — Compile, cache, and manage GLSL shader programs.
  • FrameCache — Ring-buffer of recent frames for temporal ("cache") shaders.
  • SnapshotThreadPool — Async PNG snapshot writer.
  • ACView — Main GL object: capture → filter → shade → record pipeline.
  • MainWindow — SDL2/OpenGL window host.
See also
https://lostsidedead.biz

Definition in file ACMX2/acmx.cpp.

Macro Definition Documentation

◆ CHECK_CUDA

#define CHECK_CUDA ( call)
Value:
do { \
static_cast<void>(call); \
} while (0)

Definition at line 83 of file ACMX2/acmx.cpp.

Referenced by TextureUploader::cleanup(), ACView::draw(), TextureUploader::init(), ACView::load(), and ACView::~ACView().

Typedef Documentation

◆ binary

typedef GLenum const void * binary

Definition at line 2954 of file ACMX2/acmx.cpp.

◆ binaryFormat

typedef GLenum binaryFormat

Definition at line 2954 of file ACMX2/acmx.cpp.

◆ bufSize

typedef GLsizei bufSize

Definition at line 2954 of file ACMX2/acmx.cpp.

◆ length

typedef GLenum const void GLsizei length

Definition at line 2954 of file ACMX2/acmx.cpp.

Enumeration Type Documentation

◆ FrameRotation

enum class FrameRotation
strong
Enumerator
None 
Clockwise90 
Rotate180 
Counterclockwise90 

Definition at line 6808 of file ACMX2/acmx.cpp.

◆ ShaderManifestFormat

enum class ShaderManifestFormat
strong
Enumerator
Json 
Text 

Definition at line 534 of file ACMX2/acmx.cpp.

◆ ShaderProgramKind

enum class ShaderProgramKind
strong
Enumerator
Fragment 
Compute 
ComputeUnavailable 

Definition at line 537 of file ACMX2/acmx.cpp.

Function Documentation

◆ checkDevices()

void checkDevices ( bool list_only = false)

Verify CUDA device availability and print GPU info.

Definition at line 13994 of file ACMX2/acmx.cpp.

References checkDevices().

Referenced by checkDevices(), and main().

◆ clamp01f()

float clamp01f ( float v)
inline

Definition at line 972 of file ACMX2/acmx.cpp.

References clamp01f().

Referenced by clamp01f(), hlgToLinearScalar(), linearToSrgb16(), linearToSrgb8(), and pqToLinearScalar().

◆ collectShaderLibraryEntries()

bool collectShaderLibraryEntries ( const std::string & library_path,
std::vector< std::string > & shader_files,
std::string & error )
static

◆ convertBt2020Yuv10LimitedToRgba16()

bool convertBt2020Yuv10LimitedToRgba16 ( const AVFrame * src,
cv::Mat & out )
inline

◆ executable_directory()

std::filesystem::path executable_directory ( )
static

Return the directory containing the running ACMX2 executable.

Installed ACMX2 layouts place the program in PREFIX/bin and its runtime data in PREFIX/share/acmx2. Resolving this from the executable keeps a relocated installation self-contained instead of assuming /usr/local.

Definition at line 153 of file ACMX2/acmx.cpp.

References executable_directory().

Referenced by executable_directory(), and installed_assets_directory().

◆ hlgToLinearScalar()

float hlgToLinearScalar ( float e)
inline

◆ installed_assets_directory()

std::filesystem::path installed_assets_directory ( )
static

Locate the installed ACMX2 asset root relative to the executable.

Definition at line 220 of file ACMX2/acmx.cpp.

References executable_directory(), and installed_assets_directory().

Referenced by installed_assets_directory(), and main().

◆ isComputeShaderFile()

◆ isEditorPreviewForShader()

bool isEditorPreviewForShader ( const std::filesystem::path & loaded_shader,
const std::filesystem::path & requested_path )
static

Definition at line 520 of file ACMX2/acmx.cpp.

References isEditorPreviewForShader().

Referenced by isEditorPreviewForShader().

◆ isEditorPreviewPath()

bool isEditorPreviewPath ( const std::filesystem::path & library_path,
const std::filesystem::path & requested_path )
static

Definition at line 505 of file ACMX2/acmx.cpp.

References isEditorPreviewPath().

Referenced by isEditorPreviewPath().

◆ isValidCustomUniformName()

bool isValidCustomUniformName ( const std::string & name)
static

◆ linearToSrgb16()

uint16_t linearToSrgb16 ( float v)
inline

Definition at line 1017 of file ACMX2/acmx.cpp.

References clamp01f(), and linearToSrgb16().

Referenced by linearToSrgb16(), and toneMapHdrRgba16ToSrgbRgba16().

◆ linearToSrgb8()

unsigned char linearToSrgb8 ( float v)
inline

Definition at line 1005 of file ACMX2/acmx.cpp.

References clamp01f(), and linearToSrgb8().

Referenced by linearToSrgb8(), and toneMapHdrRgba16ToSdrRgba8().

◆ loadProgramBinaryFunctions()

bool loadProgramBinaryFunctions ( )

Dynamically load glGetProgramBinary / glProgramBinary via SDL.

Definition at line 2961 of file ACMX2/acmx.cpp.

References glGetProgramBinaryFunc, glProgramBinaryFunc, and loadProgramBinaryFunctions().

Referenced by ShaderLibrary::buildShaderCache(), ShaderLibrary::loadFromCache(), and loadProgramBinaryFunctions().

◆ loadShaderManifest()

◆ main()

int main ( int argc,
char ** argv )

Application entry point.

Parses command-line arguments with Argz, validates inputs, then either builds a shader cache and exits or launches the main render loop.

Parameters
argcArgument count.
argvArgument vector.
Returns
EXIT_SUCCESS on clean exit, EXIT_FAILURE on error.

Headless GL context used exclusively by the --remove-broken CLI flag.

Mirrors BuildWindow: opens a minimal hidden 640x480 window just long enough to get a valid OpenGL context, invokes ShaderLibrary::removeBrokenShaders() once, and then exits.

Headless-style GLWindow used exclusively by the --build CLI flag.

Creates a minimal 640×480 hidden window just long enough to establish an OpenGL context, compile every shader in the library, serialise the resulting GPU program binaries to disk via ShaderLibrary::buildShaderCache(), then exit.

The window's draw() fires exactly once (guarded by build_done), performs the full cache build, and then sets active = false so buildLoop() terminates.

< Temporary shader library for compilation.

< Path to the shader source directory.

< Whether to include 3-D vertex shaders.

< Base asset path (for locating vert.glsl).

< True if buildShaderCache() succeeded.

< Guard: ensures draw() builds only once.

< Controls the buildLoop() pump.

Single-shot draw: compile all shaders, write cache, then signal exit.

On the first (and only) call, resolves vertex shader paths, invokes ShaderLibrary::buildShaderCache(), clears GPU resources, and sets active = false to break the pump.

No-op; build mode ignores all user input.

Minimal SDL event pump that drives draw() until active is cleared.

Polls SDL events (honouring SDL_QUIT), calls draw() once per iteration, and exits when the build is complete.

Definition at line 14164 of file ACMX2/acmx.cpp.

References ac_gpu::AC_FILTER_MAX, MXArguments::audio_buffers, MXArguments::audio_channels, MXArguments::audio_enabled, MXArguments::audio_file, MXArguments::audio_input, MXArguments::audio_output, MXArguments::audio_pass_through, MXArguments::audio_repeat, MXArguments::audio_sensitivty, MXArguments::audio_trunc, MXArguments::audio_warm_rate, MXArguments::autopilot_frames, MXArguments::autopilot_random_interval, MXArguments::autopilot_random_timeout, MXArguments::build_cache, MXArguments::build_library_path, ShaderLibrary::buildShaderCache(), MXArguments::cache, MXArguments::cache_array, MXArguments::cache_delay, MXArguments::cache_size, MXArguments::camera_device, checkDevices(), ShaderLibrary::clear(), Clockwise90, MXArguments::copy_audio, Counterclockwise90, MXArguments::crf, MXArguments::cross_fade_duration, MXArguments::csize, MXArguments::cuda_device, MXArguments::disable_counter, MXArguments::display_filter, MXArguments::duration, MXArguments::edge_model, ShaderLibrary::enableDualMode(), MXArguments::encode_opts, MXArguments::filename, ac_gpu::filters, MXArguments::flip_output, MXArguments::fps_value, MXArguments::fragment, MXArguments::frame_rotation, MXArguments::full, MXArguments::generate_interval, MXArguments::gpu_filter_enabled, MXArguments::gpu_filter_indices, MXArguments::gpu_frame_buffer_size, MXArguments::graphic_file, MXArguments::human_background_only, MXArguments::human_black, MXArguments::human_model, MXArguments::human_white, installed_assets_directory(), anonymous_namespace{acmx.cpp}::installHeadlessSignalHandlers(), MXArguments::interface_shm, MXArguments::is3d, MXArguments::library, acmx2::audio::AudioEngine::list_devices(), main(), OpenGLContextConfig::major, MXArguments::max_size_mb, MXArguments::midi_device, MXArguments::midi_map_file, OpenGLContextConfig::minor, MXArguments::mode, MXArguments::model_file, ac_gpu::Filter::name, MXArguments::no_drop, MXArguments::normalized_time, MXArguments::ofilename, MXArguments::onnx_model, MXArguments::path, MXArguments::playlist_file, MXArguments::png_output, MXArguments::prefix_path, printAbout(), printBranding(), probe_video_size(), MXArguments::record_audio_file, MXArguments::record_gain, MXArguments::remove_broken, MXArguments::remove_broken_path, ShaderLibrary::removeBrokenShaders(), MXArguments::repeat, Rotate180, safeGLString(), select_open_gl_context(), set_environment_if_missing(), ShaderLibrary::setCacheSize(), ShaderLibrary::setHistoryTextureArray(), MXArguments::shader_file, MXArguments::shader_index, MXArguments::shader_pass_enabled, MXArguments::shader_pass_files, MXArguments::shader_pass_list, shaderIndexForFile(), shaderManifestPath(), MXArguments::silent, MXArguments::sizev, MXArguments::slib, sortedShaderLibraryEntries(), MXArguments::th, MXArguments::time_speed, MXArguments::tw, update_compute_shader_support(), MXArguments::use_shader_cache, MXArguments::use_yuv, MXArguments::watermark_b, MXArguments::watermark_g, MXArguments::watermark_r, and MXArguments::watermark_text.

Referenced by main(), main(), and main().

◆ normalizeShaderIndexEntry()

std::optional< std::string > normalizeShaderIndexEntry ( const std::string & raw)
static

◆ pqToLinearScalar()

float pqToLinearScalar ( float e)
inline

◆ print_open_gl_uniform_limits()

void print_open_gl_uniform_limits ( )
static

Print the active driver's shader-uniform capacity in one line.

GL_MAX_UNIFORM_LOCATIONS became core in OpenGL 4.3. Older contexts still expose the per-stage component limits, so report locations as unsupported instead of issuing an invalid glGetIntegerv query.

Definition at line 365 of file ACMX2/acmx.cpp.

References print_open_gl_uniform_limits().

Referenced by ACView::load(), and print_open_gl_uniform_limits().

◆ printAbout()

void printAbout ( bool include_branding = true)

Print program information, arguments, and keyboard controls.

Definition at line 14147 of file ACMX2/acmx.cpp.

References printAbout(), printBranding(), anonymous_namespace{acmx.cpp}::printDetailedArguments(), and anonymous_namespace{acmx.cpp}::printKeyboardControls().

Referenced by main(), and printAbout().

◆ printBranding()

void printBranding ( )

Print the program name, software brand, and project URL once.

Definition at line 14140 of file ACMX2/acmx.cpp.

References printBranding(), PROGRAM_NAME, VERSION_AUTHOR, and VERSION_INFO.

Referenced by main(), printAbout(), and printBranding().

◆ probe_video_size()

std::optional< cv::Size > probe_video_size ( const std::string & filename)
static

Read a video's coded dimensions without opening a decoder.

This metadata-only probe runs before the SDL/OpenGL window is created so Default-resolution video playback can construct the window at its native size. Resizing an already-created OpenGL window is asynchronous on some window managers and can leave its drawable at the constructor's fallback size.

Returns
Native video dimensions, or std::nullopt when metadata cannot be read. The normal decoder path reports the definitive error later.

Definition at line 6827 of file ACMX2/acmx.cpp.

References probe_video_size().

Referenced by main(), and probe_video_size().

◆ resolveShaderPathInLibrary()

bool resolveShaderPathInLibrary ( const std::string & library_path,
const std::string & relative_path,
std::string & resolved_full_path )
static

◆ safeGLString()

std::string safeGLString ( GLenum name)
static

◆ select_open_gl_context()

OpenGLContextConfig select_open_gl_context ( )
static

Definition at line 338 of file ACMX2/acmx.cpp.

References select_open_gl_context().

Referenced by main(), and select_open_gl_context().

◆ set_environment_if_missing()

bool set_environment_if_missing ( const char * name,
const char * value )
static

Definition at line 208 of file ACMX2/acmx.cpp.

References set_environment_if_missing().

Referenced by main(), and set_environment_if_missing().

◆ shaderIndexForFile()

int shaderIndexForFile ( const std::vector< std::string > & shader_files,
const std::string & shader_file )
static

Definition at line 760 of file ACMX2/acmx.cpp.

References shaderIndexForFile().

Referenced by ACView::load(), main(), and shaderIndexForFile().

◆ shaderManifestPath()

std::string shaderManifestPath ( const std::string & library_path)
static

Definition at line 577 of file ACMX2/acmx.cpp.

References shaderManifestPath().

Referenced by loadShaderManifest(), main(), and shaderManifestPath().

◆ sortedShaderLibraryEntries()

std::vector< std::string > sortedShaderLibraryEntries ( const std::string & library_path)
static

◆ toneMapHdrRgba16ToSdrRgba8()

std::vector< unsigned char > toneMapHdrRgba16ToSdrRgba8 ( const std::vector< unsigned char > & hdr_pixels,
int w,
int h,
int hdr_trc )
inline

◆ toneMapHdrRgba16ToSrgbRgba16()

std::vector< uint16_t > toneMapHdrRgba16ToSrgbRgba16 ( const unsigned char * hdr_pixels,
int w,
int h,
int hdr_trc )
inline

◆ transfer_audio()

void transfer_audio ( std::string_view ,
std::string_view  )

Copy the audio track from one media file to another via FFmpeg.

References transfer_audio().

Referenced by ACView::beginMuxing(), main(), ACView::stopWriterThread(), transfer_audio(), transfer_audio(), and acmxvk::MainWindow::~MainWindow().

◆ update_compute_shader_support()

void update_compute_shader_support ( )
static

Update the feature flag from the real context rather than only the probe.

Definition at line 344 of file ACMX2/acmx.cpp.

References compute_shader_supported, and update_compute_shader_support().

Referenced by MainWindow::initCommon(), main(), and update_compute_shader_support().

◆ void()

typedef void ( APIENTRYP PFNGLGETPROGRAMBINARYPROC_LOCAL)

◆ writeJsonShaderManifest()

bool writeJsonShaderManifest ( const std::string & path,
const std::vector< std::string > & entries,
const std::vector< ShaderManifestData::CustomUniform > & custom_uniforms,
std::string & error )
static

Variable Documentation

◆ compute_shader_supported

bool compute_shader_supported = false
static

◆ FFT_SIZE

std::size_t acmx2::audio::FFT_SIZE
inlineconstexpr

Definition at line 11 of file ACMX2/audio.hpp.

Referenced by SpectrumHistory::init(), and SpectrumTexture::init().

◆ glGetProgramBinaryFunc

PFNGLGETPROGRAMBINARYPROC_LOCAL glGetProgramBinaryFunc = nullptr
static

◆ glProgramBinaryFunc

PFNGLPROGRAMBINARYPROC_LOCAL glProgramBinaryFunc = nullptr
static

Definition at line 2958 of file ACMX2/acmx.cpp.

Referenced by ShaderLibrary::loadFromCache(), and loadProgramBinaryFunctions().

◆ kDisplayFragPassthrough

const char* kDisplayFragPassthrough
constexpr
Initial value:
=
"#version 330 core\n"
"in vec2 tc;\n"
"out vec4 color;\n"
"uniform sampler2D samp;\n"
"void main() {\n"
" color = texture(samp, tc);\n"
"}\n"

Definition at line 1481 of file ACMX2/acmx.cpp.

Referenced by ACView::ensureHdrResources().

◆ kDisplayVertFlip

const char* kDisplayVertFlip
constexpr
Initial value:
=
"#version 330 core\n"
"layout(location = 0) in vec3 aPos;\n"
"layout(location = 1) in vec2 aTex;\n"
"out vec2 tc;\n"
"uniform mat4 mv_matrix;\n"
"uniform mat4 proj_matrix;\n"
"uniform int flip_y; // 1 to flip Y coordinate\n"
"void main() {\n"
" gl_Position = proj_matrix * mv_matrix * vec4(aPos, 1.0);\n"
" vec2 tex = aTex;\n"
" if (flip_y == 1) {\n"
" tex.y = 1.0 - tex.y;\n"
" }\n"
" tc = tex;\n"
"}\n"

Definition at line 1464 of file ACMX2/acmx.cpp.

Referenced by ACView::ensureHdrResources().

◆ kHdrDecodeFrag

const char* kHdrDecodeFrag
constexpr

Definition at line 1363 of file ACMX2/acmx.cpp.

Referenced by ACView::ensureHdrResources().

◆ kHdrEncodeFrag

const char* kHdrEncodeFrag
constexpr

Definition at line 1414 of file ACMX2/acmx.cpp.

Referenced by ACView::ensureHdrResources().

◆ kHdrVertPassthrough

const char* kHdrVertPassthrough
constexpr
Initial value:
=
"#version 330 core\n"
"layout(location = 0) in vec3 aPos;\n"
"layout(location = 1) in vec2 aTex;\n"
"out vec2 tc;\n"
"uniform mat4 mv_matrix;\n"
"uniform mat4 proj_matrix;\n"
"void main() {\n"
" gl_Position = proj_matrix * mv_matrix * vec4(aPos, 1.0);\n"
" tc = aTex;\n"
"}\n"

Definition at line 1351 of file ACMX2/acmx.cpp.

Referenced by ACView::ensureHdrResources(), and ACView::load().

◆ kMuxOverlayFrag

const char* kMuxOverlayFrag
constexpr

Definition at line 1490 of file ACMX2/acmx.cpp.

Referenced by ACView::load().