CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
GLSLExtensionAgent.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
13
15
18
20
22
23 // GLSL extension agent visitor. Determines which GLSL extension are required for a given GLSL target version.
24 class GLSLExtensionAgent : private Visitor {
25 private:
27
28 // Target output GLSL version.
30
31 // Minimum required GLSL version.
33
34 bool mAllowExtensions = false;
35 bool mExplicitBinding = false;
36
38
39 // Resulting set of required GLSL extensions.
41
42 // Intrinsic name to GLSL extension map.
44
45 public:
46 // Returns a set of strings with all required extensions for the specified program and target output GLSL version.
48 bool explicitBinding, bool separateShaders, const OnReportProc& onReportExtension = nullptr);
49
50 private:
52 void acquireExtension(const String& extension, const String& reason = "", const AST* ast = nullptr);
53
54 private: // Visitor implementation
57
60
65
72 };
73
74} // namespace CeresEngine::ShaderCompiler
#define DECLARATION_VISIT_PROC(CLASS_NAME)
Definition Visitor.hpp:88
Definition GLSLExtensionAgent.hpp:24
Set< String > mExtensions
Definition GLSLExtensionAgent.hpp:40
Set< String > determineRequiredExtensions(Program &program, OutputShaderVersion &targetGLSLVersion, const ShaderTarget shaderTarget, bool allowExtensions, bool explicitBinding, bool separateShaders, const OnReportProc &onReportExtension=nullptr)
Map< Intrinsic, const char * > mIntrinsicextensionMap
Definition GLSLExtensionAgent.hpp:43
void acquireExtension(const String &extension, const String &reason="", const AST *ast=nullptr)
ShaderTarget mShaderTarget
Definition GLSLExtensionAgent.hpp:26
bool mAllowExtensions
Definition GLSLExtensionAgent.hpp:34
OnReportProc mOnReportExtension
Definition GLSLExtensionAgent.hpp:37
OutputShaderVersion mMinGLSLVersion
Definition GLSLExtensionAgent.hpp:32
OutputShaderVersion mTargetGLSLVersion
Definition GLSLExtensionAgent.hpp:29
bool mExplicitBinding
Definition GLSLExtensionAgent.hpp:35
Definition Visitor.hpp:92
Definition AST.hpp:33
ShaderTarget
Shader target enumeration.
Definition Targets.hpp:16
@ Undefined
Undefined shader target.
Function< void(const String &msg, const AST *ast) const > OnReportProc
Definition ReportHandler.hpp:28
OutputShaderVersion
Output shader version enumeration.
Definition Targets.hpp:67
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::set< Key, Compare, ScopedAllocatorAdaptor< StdAllocator< Key, RawAllocator > > > Set
Set is an associative container that contains a sorted set of unique objects of type Key.
Definition Set.hpp:21
std::map< Key, T, Compare, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > Map
Map is a sorted associative container that contains key-value pairs with unique keys.
Definition Map.hpp:24