Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Functions | Variables
SkSLSPIRVCodeGenerator.cpp File Reference
#include "src/sksl/codegen/SkSLSPIRVCodeGenerator.h"
#include "include/core/SkSpan.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkTArray.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkEnumBitMask.h"
#include "src/core/SkChecksum.h"
#include "src/core/SkTHash.h"
#include "src/core/SkTraceEvent.h"
#include "src/sksl/GLSL.std.450.h"
#include "src/sksl/SkSLAnalysis.h"
#include "src/sksl/SkSLBuiltinTypes.h"
#include "src/sksl/SkSLCompiler.h"
#include "src/sksl/SkSLConstantFolder.h"
#include "src/sksl/SkSLContext.h"
#include "src/sksl/SkSLDefines.h"
#include "src/sksl/SkSLErrorReporter.h"
#include "src/sksl/SkSLIntrinsicList.h"
#include "src/sksl/SkSLMemoryLayout.h"
#include "src/sksl/SkSLOperator.h"
#include "src/sksl/SkSLOutputStream.h"
#include "src/sksl/SkSLPool.h"
#include "src/sksl/SkSLPosition.h"
#include "src/sksl/SkSLProgramSettings.h"
#include "src/sksl/SkSLStringStream.h"
#include "src/sksl/SkSLUtil.h"
#include "src/sksl/codegen/SkSLCodeGenerator.h"
#include "src/sksl/ir/SkSLBinaryExpression.h"
#include "src/sksl/ir/SkSLBlock.h"
#include "src/sksl/ir/SkSLConstructor.h"
#include "src/sksl/ir/SkSLConstructorArrayCast.h"
#include "src/sksl/ir/SkSLConstructorCompound.h"
#include "src/sksl/ir/SkSLConstructorCompoundCast.h"
#include "src/sksl/ir/SkSLConstructorDiagonalMatrix.h"
#include "src/sksl/ir/SkSLConstructorMatrixResize.h"
#include "src/sksl/ir/SkSLConstructorScalarCast.h"
#include "src/sksl/ir/SkSLConstructorSplat.h"
#include "src/sksl/ir/SkSLDoStatement.h"
#include "src/sksl/ir/SkSLExpression.h"
#include "src/sksl/ir/SkSLExpressionStatement.h"
#include "src/sksl/ir/SkSLExtension.h"
#include "src/sksl/ir/SkSLFieldAccess.h"
#include "src/sksl/ir/SkSLFieldSymbol.h"
#include "src/sksl/ir/SkSLForStatement.h"
#include "src/sksl/ir/SkSLFunctionCall.h"
#include "src/sksl/ir/SkSLFunctionDeclaration.h"
#include "src/sksl/ir/SkSLFunctionDefinition.h"
#include "src/sksl/ir/SkSLIRHelpers.h"
#include "src/sksl/ir/SkSLIRNode.h"
#include "src/sksl/ir/SkSLIfStatement.h"
#include "src/sksl/ir/SkSLIndexExpression.h"
#include "src/sksl/ir/SkSLInterfaceBlock.h"
#include "src/sksl/ir/SkSLLayout.h"
#include "src/sksl/ir/SkSLLiteral.h"
#include "src/sksl/ir/SkSLModifierFlags.h"
#include "src/sksl/ir/SkSLModifiersDeclaration.h"
#include "src/sksl/ir/SkSLPoison.h"
#include "src/sksl/ir/SkSLPostfixExpression.h"
#include "src/sksl/ir/SkSLPrefixExpression.h"
#include "src/sksl/ir/SkSLProgram.h"
#include "src/sksl/ir/SkSLProgramElement.h"
#include "src/sksl/ir/SkSLReturnStatement.h"
#include "src/sksl/ir/SkSLSetting.h"
#include "src/sksl/ir/SkSLStatement.h"
#include "src/sksl/ir/SkSLSwitchCase.h"
#include "src/sksl/ir/SkSLSwitchStatement.h"
#include "src/sksl/ir/SkSLSwizzle.h"
#include "src/sksl/ir/SkSLSymbol.h"
#include "src/sksl/ir/SkSLSymbolTable.h"
#include "src/sksl/ir/SkSLTernaryExpression.h"
#include "src/sksl/ir/SkSLType.h"
#include "src/sksl/ir/SkSLVarDeclarations.h"
#include "src/sksl/ir/SkSLVariable.h"
#include "src/sksl/ir/SkSLVariableReference.h"
#include "src/sksl/spirv.h"
#include "src/sksl/transform/SkSLTransform.h"
#include "src/utils/SkBitSet.h"
#include <cstdint>
#include <cstring>
#include <memory>
#include <set>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  SkSL::SPIRVCodeGenerator
 
class  SkSL::SPIRVCodeGenerator::LValue
 
struct  SkSL::SPIRVCodeGenerator::Instruction::Hash
 
struct  SkSL::SPIRVCodeGenerator::Word
 
class  SkSL::PointerLValue
 
class  SkSL::SwizzleLValue
 

Namespaces

namespace  SkSL
 

Macros

#define kLast_Capability   SpvCapabilityMultiViewport
 
#define ALL_GLSL(x)
 
#define BY_TYPE_GLSL(ifFloat, ifInt, ifUInt)
 
#define ALL_SPIRV(x)
 
#define BOOL_SPIRV(x)
 
#define FLOAT_SPIRV(x)
 
#define SPECIAL(x)
 
#define PACK(type)
 

Functions

static bool SkSL::is_float (const Type &type)
 
static bool SkSL::is_signed (const Type &type)
 
static bool SkSL::is_unsigned (const Type &type)
 
static bool SkSL::is_bool (const Type &type)
 
template<typename T >
static T SkSL::pick_by_type (const Type &type, T ifFloat, T ifInt, T ifUInt, T ifBool)
 
static bool SkSL::is_out (ModifierFlags f)
 
static bool SkSL::is_in (ModifierFlags f)
 
static bool SkSL::is_control_flow_op (SpvOp_ op)
 
static bool SkSL::is_globally_reachable_op (SpvOp_ op)
 
static SpvImageFormat SkSL::layout_flags_to_image_format (LayoutFlags flags)
 
static SpvStorageClass_ SkSL::get_storage_class_for_global_variable (const Variable &var, SpvStorageClass_ fallbackStorageClass)
 
static SpvStorageClass_ SkSL::get_storage_class (const Expression &expr)
 
static bool SkSL::types_match (const Type &a, const Type &b)
 
static bool SkSL::is_vardecl_compile_time_constant (const VarDeclaration &varDecl)
 
static SymbolTable * SkSL::get_top_level_symbol_table (const FunctionDeclaration &anyFunc)
 
bool SkSL::ToSPIRV (Program &program, const ShaderCaps *caps, OutputStream &out)
 
bool SkSL::ToSPIRV (Program &program, const ShaderCaps *caps, std::string *out)
 

Variables

constexpr int DEVICE_FRAGCOORDS_BUILTIN = -1000
 
constexpr int DEVICE_CLOCKWISE_BUILTIN = -1001
 
static constexpr SkSL::Layout kDefaultTypeLayout
 
static const int32_t SkSL::SKSL_MAGIC = 0x001F0000
 

Macro Definition Documentation

◆ ALL_GLSL

#define ALL_GLSL (   x)
Value:
Intrinsic{kGLSL_STD_450_IntrinsicOpcodeKind, GLSLstd450 ## x, \
GLSLstd450 ## x, GLSLstd450 ## x, GLSLstd450 ## x}
GLSLstd450
Definition: GLSL.std.450.h:33
double x

◆ ALL_SPIRV

#define ALL_SPIRV (   x)
Value:
Intrinsic{kSPIRV_IntrinsicOpcodeKind, \
SpvOp ## x, SpvOp ## x, SpvOp ## x, SpvOp ## x}
enum SpvOp_ SpvOp

◆ BOOL_SPIRV

#define BOOL_SPIRV (   x)
Value:
Intrinsic{kSPIRV_IntrinsicOpcodeKind, \
SpvOpUndef, SpvOpUndef, SpvOpUndef, SpvOp ## x}
@ SpvOpUndef
Definition: spirv.h:575

◆ BY_TYPE_GLSL

#define BY_TYPE_GLSL (   ifFloat,
  ifInt,
  ifUInt 
)
Value:
Intrinsic{kGLSL_STD_450_IntrinsicOpcodeKind, \
GLSLstd450 ## ifFloat, \
GLSLstd450 ## ifInt, \
GLSLstd450 ## ifUInt, \
SpvOpUndef}

◆ FLOAT_SPIRV

#define FLOAT_SPIRV (   x)
Value:
Intrinsic{kSPIRV_IntrinsicOpcodeKind, \

◆ kLast_Capability

#define kLast_Capability   SpvCapabilityMultiViewport

Definition at line 103 of file SkSLSPIRVCodeGenerator.cpp.

◆ PACK

#define PACK (   type)
Value:
case k_pack##type##_IntrinsicKind: return ALL_GLSL(Pack##type); \
case k_unpack##type##_IntrinsicKind: return ALL_GLSL(Unpack##type)
#define ALL_GLSL(x)
GLenum type
static void * Pack(const T &ctx, SkArenaAlloc *alloc)
static UnpackedType< T > Unpack(const T *ctx)

◆ SPECIAL

#define SPECIAL (   x)
Value:
Intrinsic{kSpecial_IntrinsicOpcodeKind, k ## x ## _SpecialIntrinsic, \
k ## x ## _SpecialIntrinsic, k ## x ## _SpecialIntrinsic, \
k ## x ## _SpecialIntrinsic}

Variable Documentation

◆ DEVICE_CLOCKWISE_BUILTIN

constexpr int DEVICE_CLOCKWISE_BUILTIN = -1001
constexpr

Definition at line 106 of file SkSLSPIRVCodeGenerator.cpp.

◆ DEVICE_FRAGCOORDS_BUILTIN

constexpr int DEVICE_FRAGCOORDS_BUILTIN = -1000
constexpr

Definition at line 105 of file SkSLSPIRVCodeGenerator.cpp.

◆ kDefaultTypeLayout

constexpr SkSL::Layout kDefaultTypeLayout
staticconstexpr

Definition at line 107 of file SkSLSPIRVCodeGenerator.cpp.