blob: ea160b195daec14f8b883b4a0c0f4dc4ad40031f [file] [log] [blame]
ethannicholasb3058bd2016-07-01 08:22:01 -07001/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
Ethan Nicholasbcf35f82017-03-30 18:42:48 +00007
ethannicholasb3058bd2016-07-01 08:22:01 -07008#ifndef SKSL_SPIRVCODEGENERATOR
9#define SKSL_SPIRVCODEGENERATOR
10
ethannicholasb3058bd2016-07-01 08:22:01 -070011#include <stack>
12#include <tuple>
13#include <unordered_map>
14
Ethan Nicholasbcf35f82017-03-30 18:42:48 +000015#include "SkStream.h"
ethannicholasb3058bd2016-07-01 08:22:01 -070016#include "SkSLCodeGenerator.h"
ethannicholas8ac838d2016-11-22 08:39:36 -080017#include "SkSLMemoryLayout.h"
ethannicholasb3058bd2016-07-01 08:22:01 -070018#include "ir/SkSLBinaryExpression.h"
19#include "ir/SkSLBoolLiteral.h"
20#include "ir/SkSLConstructor.h"
Ethan Nicholasfd146aa2017-01-13 16:40:35 -050021#include "ir/SkSLDoStatement.h"
ethannicholasb3058bd2016-07-01 08:22:01 -070022#include "ir/SkSLFloatLiteral.h"
23#include "ir/SkSLIfStatement.h"
24#include "ir/SkSLIndexExpression.h"
25#include "ir/SkSLInterfaceBlock.h"
26#include "ir/SkSLIntLiteral.h"
27#include "ir/SkSLFieldAccess.h"
28#include "ir/SkSLForStatement.h"
29#include "ir/SkSLFunctionCall.h"
30#include "ir/SkSLFunctionDeclaration.h"
31#include "ir/SkSLFunctionDefinition.h"
32#include "ir/SkSLPrefixExpression.h"
33#include "ir/SkSLPostfixExpression.h"
34#include "ir/SkSLProgramElement.h"
35#include "ir/SkSLReturnStatement.h"
36#include "ir/SkSLStatement.h"
37#include "ir/SkSLSwizzle.h"
38#include "ir/SkSLTernaryExpression.h"
ethannicholas22f939e2016-10-13 13:25:34 -070039#include "ir/SkSLVarDeclarations.h"
40#include "ir/SkSLVarDeclarationsStatement.h"
ethannicholasb3058bd2016-07-01 08:22:01 -070041#include "ir/SkSLVariableReference.h"
Ethan Nicholasfd146aa2017-01-13 16:40:35 -050042#include "ir/SkSLWhileStatement.h"
ethannicholasb3058bd2016-07-01 08:22:01 -070043#include "spirv.h"
44
45namespace SkSL {
46
47#define kLast_Capability SpvCapabilityMultiViewport
48
49/**
50 * Converts a Program into a SPIR-V binary.
51 */
52class SPIRVCodeGenerator : public CodeGenerator {
53public:
54 class LValue {
55 public:
56 virtual ~LValue() {}
Greg Daniel64773e62016-11-22 09:44:03 -050057
ethannicholasb3058bd2016-07-01 08:22:01 -070058 // returns a pointer to the lvalue, if possible. If the lvalue cannot be directly referenced
59 // by a pointer (e.g. vector swizzles), returns 0.
60 virtual SpvId getPointer() = 0;
61
Ethan Nicholasbcf35f82017-03-30 18:42:48 +000062 virtual SpvId load(SkWStream& out) = 0;
ethannicholasb3058bd2016-07-01 08:22:01 -070063
Ethan Nicholasbcf35f82017-03-30 18:42:48 +000064 virtual void store(SpvId value, SkWStream& out) = 0;
ethannicholasb3058bd2016-07-01 08:22:01 -070065 };
66
Ethan Nicholas941e7e22016-12-12 15:33:30 -050067 SPIRVCodeGenerator(const Context* context, const Program* program, ErrorReporter* errors,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +000068 SkWStream* out)
Ethan Nicholas941e7e22016-12-12 15:33:30 -050069 : INHERITED(program, errors, out)
70 , fContext(*context)
ethannicholas8ac838d2016-11-22 08:39:36 -080071 , fDefaultLayout(MemoryLayout::k140_Standard)
ethannicholasd598f792016-07-25 10:08:54 -070072 , fCapabilities(1 << SpvCapabilityShader)
ethannicholasb3058bd2016-07-01 08:22:01 -070073 , fIdCount(1)
74 , fBoolTrue(0)
75 , fBoolFalse(0)
Ethan Nicholas941e7e22016-12-12 15:33:30 -050076 , fSetupFragPosition(false)
Ethan Nicholas8feeff92017-03-30 14:11:58 -040077 , fCurrentBlock(0)
78 , fSynthetics(nullptr, errors) {
ethannicholasb3058bd2016-07-01 08:22:01 -070079 this->setupIntrinsics();
80 }
81
Ethan Nicholas941e7e22016-12-12 15:33:30 -050082 bool generateCode() override;
ethannicholasb3058bd2016-07-01 08:22:01 -070083
84private:
85 enum IntrinsicKind {
86 kGLSL_STD_450_IntrinsicKind,
87 kSPIRV_IntrinsicKind,
88 kSpecial_IntrinsicKind
89 };
90
91 enum SpecialIntrinsic {
92 kAtan_SpecialIntrinsic,
93 kTexture_SpecialIntrinsic,
Greg Daniel64773e62016-11-22 09:44:03 -050094 kSubpassLoad_SpecialIntrinsic,
ethannicholasb3058bd2016-07-01 08:22:01 -070095 };
96
97 void setupIntrinsics();
98
99 SpvId nextId();
100
101 SpvId getType(const Type& type);
102
ethannicholas8ac838d2016-11-22 08:39:36 -0800103 SpvId getType(const Type& type, const MemoryLayout& layout);
104
ethannicholasd598f792016-07-25 10:08:54 -0700105 SpvId getFunctionType(const FunctionDeclaration& function);
ethannicholasb3058bd2016-07-01 08:22:01 -0700106
ethannicholasd598f792016-07-25 10:08:54 -0700107 SpvId getPointerType(const Type& type, SpvStorageClass_ storageClass);
ethannicholasb3058bd2016-07-01 08:22:01 -0700108
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500109 SpvId getPointerType(const Type& type, const MemoryLayout& layout,
ethannicholas8ac838d2016-11-22 08:39:36 -0800110 SpvStorageClass_ storageClass);
111
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000112 std::vector<SpvId> getAccessChain(const Expression& expr, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700113
114 void writeLayout(const Layout& layout, SpvId target);
115
116 void writeLayout(const Layout& layout, SpvId target, int member);
117
ethannicholas8ac838d2016-11-22 08:39:36 -0800118 void writeStruct(const Type& type, const MemoryLayout& layout, SpvId resultId);
ethannicholasb3058bd2016-07-01 08:22:01 -0700119
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000120 void writeProgramElement(const ProgramElement& pe, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700121
ethannicholasf789b382016-08-03 12:43:36 -0700122 SpvId writeInterfaceBlock(const InterfaceBlock& intf);
ethannicholasb3058bd2016-07-01 08:22:01 -0700123
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000124 SpvId writeFunctionStart(const FunctionDeclaration& f, SkWStream& out);
125
126 SpvId writeFunctionDeclaration(const FunctionDeclaration& f, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700127
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000128 SpvId writeFunction(const FunctionDefinition& f, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700129
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000130 void writeGlobalVars(Program::Kind kind, const VarDeclarations& v, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700131
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000132 void writeVarDeclarations(const VarDeclarations& decl, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700133
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000134 SpvId writeVariableReference(const VariableReference& ref, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700135
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000136 std::unique_ptr<LValue> getLValue(const Expression& value, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700137
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000138 SpvId writeExpression(const Expression& expr, SkWStream& out);
139
140 SpvId writeIntrinsicCall(const FunctionCall& c, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700141
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000142 SpvId writeFunctionCall(const FunctionCall& c, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700143
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000144 SpvId writeSpecialIntrinsic(const FunctionCall& c, SpecialIntrinsic kind, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700145
ethannicholasf789b382016-08-03 12:43:36 -0700146 SpvId writeConstantVector(const Constructor& c);
ethannicholasb3058bd2016-07-01 08:22:01 -0700147
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000148 SpvId writeFloatConstructor(const Constructor& c, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700149
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000150 SpvId writeIntConstructor(const Constructor& c, SkWStream& out);
Ethan Nicholas84645e32017-02-09 13:57:14 -0500151
152 /**
153 * Writes a matrix with the diagonal entries all equal to the provided expression, and all other
154 * entries equal to zero.
155 */
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000156 void writeUniformScaleMatrix(SpvId id, SpvId diagonal, const Type& type, SkWStream& out);
Ethan Nicholas84645e32017-02-09 13:57:14 -0500157
158 /**
159 * Writes a potentially-different-sized copy of a matrix. Entries which do not exist in the
160 * source matrix are filled with zero; entries which do not exist in the destination matrix are
161 * ignored.
162 */
163 void writeMatrixCopy(SpvId id, SpvId src, const Type& srcType, const Type& dstType,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000164 SkWStream& out);
Ethan Nicholas84645e32017-02-09 13:57:14 -0500165
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000166 SpvId writeMatrixConstructor(const Constructor& c, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700167
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000168 SpvId writeVectorConstructor(const Constructor& c, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700169
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000170 SpvId writeConstructor(const Constructor& c, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700171
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000172 SpvId writeFieldAccess(const FieldAccess& f, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700173
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000174 SpvId writeSwizzle(const Swizzle& swizzle, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700175
Ethan Nicholasef653b82017-02-21 13:50:00 -0500176 /**
177 * Folds the potentially-vector result of a logical operation down to a single bool. If
178 * operandType is a vector type, assumes that the intermediate result in id is a bvec of the
179 * same dimensions, and applys all() to it to fold it down to a single bool value. Otherwise,
180 * returns the original id value.
181 */
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000182 SpvId foldToBool(SpvId id, const Type& operandType, SkWStream& out);
Ethan Nicholasef653b82017-02-21 13:50:00 -0500183
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500184 SpvId writeBinaryOperation(const Type& resultType, const Type& operandType, SpvId lhs,
185 SpvId rhs, SpvOp_ ifFloat, SpvOp_ ifInt, SpvOp_ ifUInt,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000186 SpvOp_ ifBool, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700187
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500188 SpvId writeBinaryOperation(const BinaryExpression& expr, SpvOp_ ifFloat, SpvOp_ ifInt,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000189 SpvOp_ ifUInt, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700190
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000191 SpvId writeBinaryExpression(const BinaryExpression& b, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700192
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000193 SpvId writeTernaryExpression(const TernaryExpression& t, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700194
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000195 SpvId writeIndexExpression(const IndexExpression& expr, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700196
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000197 SpvId writeLogicalAnd(const BinaryExpression& b, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700198
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000199 SpvId writeLogicalOr(const BinaryExpression& o, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700200
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000201 SpvId writePrefixExpression(const PrefixExpression& p, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700202
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000203 SpvId writePostfixExpression(const PostfixExpression& p, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700204
ethannicholasf789b382016-08-03 12:43:36 -0700205 SpvId writeBoolLiteral(const BoolLiteral& b);
ethannicholasb3058bd2016-07-01 08:22:01 -0700206
ethannicholasf789b382016-08-03 12:43:36 -0700207 SpvId writeIntLiteral(const IntLiteral& i);
ethannicholasb3058bd2016-07-01 08:22:01 -0700208
ethannicholasf789b382016-08-03 12:43:36 -0700209 SpvId writeFloatLiteral(const FloatLiteral& f);
ethannicholasb3058bd2016-07-01 08:22:01 -0700210
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000211 void writeStatement(const Statement& s, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700212
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000213 void writeBlock(const Block& b, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700214
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000215 void writeIfStatement(const IfStatement& stmt, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700216
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000217 void writeForStatement(const ForStatement& f, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700218
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000219 void writeWhileStatement(const WhileStatement& w, SkWStream& out);
Ethan Nicholasfd146aa2017-01-13 16:40:35 -0500220
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000221 void writeDoStatement(const DoStatement& d, SkWStream& out);
Ethan Nicholasfd146aa2017-01-13 16:40:35 -0500222
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000223 void writeReturnStatement(const ReturnStatement& r, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700224
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000225 void writeCapabilities(SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700226
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000227 void writeInstructions(const Program& program, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700228
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000229 void writeOpCode(SpvOp_ opCode, int length, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700230
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000231 void writeWord(int32_t word, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700232
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000233 void writeString(const char* string, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700234
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000235 void writeLabel(SpvId id, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700236
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000237 void writeInstruction(SpvOp_ opCode, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700238
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000239 void writeInstruction(SpvOp_ opCode, const char* string, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700240
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000241 void writeInstruction(SpvOp_ opCode, int32_t word1, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700242
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000243 void writeInstruction(SpvOp_ opCode, int32_t word1, const char* string, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700244
245 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, const char* string,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000246 SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700247
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000248 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700249
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500250 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, int32_t word3,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000251 SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700252
253 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, int32_t word3, int32_t word4,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000254 SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700255
256 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, int32_t word3, int32_t word4,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000257 int32_t word5, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700258
259 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, int32_t word3, int32_t word4,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000260 int32_t word5, int32_t word6, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700261
262 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, int32_t word3, int32_t word4,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000263 int32_t word5, int32_t word6, int32_t word7, SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700264
265 void writeInstruction(SpvOp_ opCode, int32_t word1, int32_t word2, int32_t word3, int32_t word4,
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500266 int32_t word5, int32_t word6, int32_t word7, int32_t word8,
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000267 SkWStream& out);
ethannicholasb3058bd2016-07-01 08:22:01 -0700268
ethannicholasd598f792016-07-25 10:08:54 -0700269 const Context& fContext;
ethannicholas8ac838d2016-11-22 08:39:36 -0800270 const MemoryLayout fDefaultLayout;
ethannicholasd598f792016-07-25 10:08:54 -0700271
ethannicholasb3058bd2016-07-01 08:22:01 -0700272 uint64_t fCapabilities;
273 SpvId fIdCount;
274 SpvId fGLSLExtendedInstructions;
275 typedef std::tuple<IntrinsicKind, int32_t, int32_t, int32_t, int32_t> Intrinsic;
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000276 std::unordered_map<SkString, Intrinsic> fIntrinsicMap;
ethannicholasd598f792016-07-25 10:08:54 -0700277 std::unordered_map<const FunctionDeclaration*, SpvId> fFunctionMap;
278 std::unordered_map<const Variable*, SpvId> fVariableMap;
279 std::unordered_map<const Variable*, int32_t> fInterfaceBlockMap;
Ethan Nicholasbcf35f82017-03-30 18:42:48 +0000280 std::unordered_map<SkString, SpvId> fTypeMap;
281 SkDynamicMemoryWStream fCapabilitiesBuffer;
282 SkDynamicMemoryWStream fGlobalInitializersBuffer;
283 SkDynamicMemoryWStream fConstantBuffer;
284 SkDynamicMemoryWStream fExtraGlobalsBuffer;
285 SkDynamicMemoryWStream fExternalFunctionsBuffer;
286 SkDynamicMemoryWStream fVariableBuffer;
287 SkDynamicMemoryWStream fNameBuffer;
288 SkDynamicMemoryWStream fDecorationBuffer;
ethannicholasb3058bd2016-07-01 08:22:01 -0700289
290 SpvId fBoolTrue;
291 SpvId fBoolFalse;
292 std::unordered_map<int64_t, SpvId> fIntConstants;
293 std::unordered_map<uint64_t, SpvId> fUIntConstants;
294 std::unordered_map<float, SpvId> fFloatConstants;
295 std::unordered_map<double, SpvId> fDoubleConstants;
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500296 bool fSetupFragPosition;
ethannicholasb3058bd2016-07-01 08:22:01 -0700297 // label of the current block, or 0 if we are not in a block
298 SpvId fCurrentBlock;
299 std::stack<SpvId> fBreakTarget;
300 std::stack<SpvId> fContinueTarget;
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500301 SpvId fRTHeightStructId = (SpvId) -1;
302 SpvId fRTHeightFieldIndex = (SpvId) -1;
Ethan Nicholas8feeff92017-03-30 14:11:58 -0400303 // holds variables synthesized during output, for lifetime purposes
304 SymbolTable fSynthetics;
ethannicholasb3058bd2016-07-01 08:22:01 -0700305
306 friend class PointerLValue;
307 friend class SwizzleLValue;
Ethan Nicholas941e7e22016-12-12 15:33:30 -0500308
309 typedef CodeGenerator INHERITED;
ethannicholasb3058bd2016-07-01 08:22:01 -0700310};
311
312}
313
314#endif