Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
impeller::compiler::SPIRVCompilerOptions Struct Reference

#include <spirv_compiler.h>

Public Member Functions

shaderc::CompileOptions BuildShadercOptions () const
 

Public Attributes

bool generate_debug_info = true
 
std::optional< shaderc_source_language > source_langauge
 
std::optional< SPIRVCompilerSourceProfilesource_profile
 
shaderc_optimization_level optimization_level
 
std::optional< SPIRVCompilerTargetEnvtarget
 
std::vector< std::string > macro_definitions
 
std::shared_ptr< Includerincluder
 
bool relaxed_vulkan_rules = false
 

Detailed Description

Definition at line 32 of file spirv_compiler.h.

Member Function Documentation

◆ BuildShadercOptions()

shaderc::CompileOptions impeller::compiler::SPIRVCompilerOptions::BuildShadercOptions ( ) const

Definition at line 276 of file spirv_compiler.cc.

276 {
277 shaderc::CompileOptions options;
278
281
282 options.SetAutoBindUniforms(true);
283 options.SetAutoMapLocations(true);
284
285 options.SetOptimizationLevel(optimization_level);
286
288 options.SetGenerateDebugInfo();
289 }
290
291 if (source_langauge.has_value()) {
292 options.SetSourceLanguage(source_langauge.value());
293 }
294
295 if (source_profile.has_value()) {
296 options.SetForcedVersionProfile(source_profile->version,
297 source_profile->profile);
298 }
299
300 if (target.has_value()) {
301 options.SetTargetEnvironment(target->env, target->version);
302 options.SetTargetSpirv(target->spirv_version);
303 }
304
305 for (const auto& macro : macro_definitions) {
306 options.AddMacroDefinition(macro);
307 }
308
309 if (includer) {
311 }
312
313 options.SetVulkanRulesRelaxed(relaxed_vulkan_rules);
314
315 return options;
316}
const char * options
static std::unique_ptr< UniqueIncluder > Make(std::shared_ptr< Includer > includer)
static void SetBindingBaseOffset(shaderc::CompileOptions &options)
static void SetDefaultLimitations(shaderc::CompileOptions &compiler_opts)
std::optional< shaderc_source_language > source_langauge
std::vector< std::string > macro_definitions
shaderc_optimization_level optimization_level
std::optional< SPIRVCompilerSourceProfile > source_profile
std::shared_ptr< Includer > includer
std::optional< SPIRVCompilerTargetEnv > target

Member Data Documentation

◆ generate_debug_info

bool impeller::compiler::SPIRVCompilerOptions::generate_debug_info = true

Definition at line 33 of file spirv_compiler.h.

◆ includer

std::shared_ptr<Includer> impeller::compiler::SPIRVCompilerOptions::includer

Definition at line 50 of file spirv_compiler.h.

◆ macro_definitions

std::vector<std::string> impeller::compiler::SPIRVCompilerOptions::macro_definitions

Definition at line 48 of file spirv_compiler.h.

◆ optimization_level

shaderc_optimization_level impeller::compiler::SPIRVCompilerOptions::optimization_level
Initial value:
=
shaderc_optimization_level::shaderc_optimization_level_performance

Definition at line 40 of file spirv_compiler.h.

◆ relaxed_vulkan_rules

bool impeller::compiler::SPIRVCompilerOptions::relaxed_vulkan_rules = false

Definition at line 52 of file spirv_compiler.h.

◆ source_langauge

std::optional<shaderc_source_language> impeller::compiler::SPIRVCompilerOptions::source_langauge

Definition at line 37 of file spirv_compiler.h.

◆ source_profile

std::optional<SPIRVCompilerSourceProfile> impeller::compiler::SPIRVCompilerOptions::source_profile

Definition at line 38 of file spirv_compiler.h.

◆ target

std::optional<SPIRVCompilerTargetEnv> impeller::compiler::SPIRVCompilerOptions::target

Definition at line 46 of file spirv_compiler.h.


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