VapourSynth-llvmexpr
Loading...
Searching...
No Matches
GLSLGenerator Class Reference

#include <llvmexpr/codegen/glsl/GLSLGenerator.hpp>

Public Member Functions

 GLSLGenerator (const std::vector< Token > &tokens, int num_inputs, int num_intermediate_inputs, int width, int height, bool mirror_boundary, const std::map< std::pair< int, std::string >, int > &prop_map, const analysis::ExpressionAnalysisResults &analysis_results)
std::string generate ()

Detailed Description

Copyright (C) 2025 yuygfgg

This file is part of Vapoursynth-llvmexpr.

Vapoursynth-llvmexpr is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Vapoursynth-llvmexpr is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Vapoursynth-llvmexpr. If not, see https://www.gnu.org/licenses/.

Definition at line 35 of file GLSLGenerator.hpp.

Constructor & Destructor Documentation

◆ GLSLGenerator()

GLSLGenerator::GLSLGenerator ( const std::vector< Token > & tokens,
int num_inputs,
int num_intermediate_inputs,
int width,
int height,
bool mirror_boundary,
const std::map< std::pair< int, std::string >, int > & prop_map,
const analysis::ExpressionAnalysisResults & analysis_results )

Copyright (C) 2025 yuygfgg

This file is part of Vapoursynth-llvmexpr.

Vapoursynth-llvmexpr is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Vapoursynth-llvmexpr is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Vapoursynth-llvmexpr. If not, see https://www.gnu.org/licenses/.

Definition at line 31 of file GLSLGenerator.cpp.

37 : tokens(tokens), num_inputs(num_inputs),
38 num_intermediate_inputs(num_intermediate_inputs),
39 mirror_boundary(mirror_boundary), prop_map(prop_map),
40 analysis(analysis_results) {
41
42 const auto& var_result = analysis.getVariableUsageResult();
43 for (const auto& var_name : var_result.all_vars) {
44 user_variables.insert(var_name);
45 }
46
47#ifndef NDEBUG
48 if (const char* env = std::getenv("LLVMEXPR_GLSL_STRUCTURIZECFG_DEBUG")) {
49 // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
50 debug_structurize_cfg = (env[0] != '\0' && env[0] != '0');
51 }
52#endif
53}

Member Function Documentation

◆ generate()

std::string GLSLGenerator::generate ( )
nodiscard

Definition at line 306 of file GLSLGenerator.cpp.

306 {
307 out.str("");
308 out.clear();
309 indent_level = 0;
310 temp_counter = 0;
311 slot_counter = 0;
312 break_flag_counter = 0;
313 loop_break_flags.clear();
314 stack.clear();
315
316 emitHeader();
317 emitBufferDeclarations();
318 emitHelperFunctions();
319 emitMainFunction();
320
321 return out.str();
322}

The documentation for this class was generated from the following files: