Remove FragmentProgram.compile() (flutter/engine#34855)

This commit is contained in:
Zachary Anderson
2022-07-22 18:30:54 -07:00
committed by GitHub
parent 57d961b3ac
commit 8cd062be3c
134 changed files with 73 additions and 4889 deletions

View File

@@ -160,7 +160,6 @@ group("unittests") {
"//flutter/display_list:display_list_unittests",
"//flutter/flow:flow_unittests",
"//flutter/fml:fml_unittests",
"//flutter/lib/spirv/test",
"//flutter/lib/ui:ui_unittests",
"//flutter/runtime:dart_plugin_registrant_unittests",
"//flutter/runtime:no_dart_plugin_registrant_unittests",

View File

@@ -883,12 +883,6 @@ FILE: ../../../flutter/lib/io/dart_io.cc
FILE: ../../../flutter/lib/io/dart_io.h
FILE: ../../../flutter/lib/snapshot/libraries.json
FILE: ../../../flutter/lib/snapshot/snapshot.h
FILE: ../../../flutter/lib/spirv/lib/spirv.dart
FILE: ../../../flutter/lib/spirv/lib/src/constants.dart
FILE: ../../../flutter/lib/spirv/lib/src/function.dart
FILE: ../../../flutter/lib/spirv/lib/src/instructions.dart
FILE: ../../../flutter/lib/spirv/lib/src/transpiler.dart
FILE: ../../../flutter/lib/spirv/lib/src/types.dart
FILE: ../../../flutter/lib/ui/annotations.dart
FILE: ../../../flutter/lib/ui/channel_buffers.dart
FILE: ../../../flutter/lib/ui/compositing.dart

View File

@@ -240,14 +240,10 @@ template("impellerc") {
assert(defined(invoker.shaders), "Impeller shaders must be specified.")
assert(defined(invoker.shader_target_flag),
"The flag to impellerc for target selection must be specified.")
assert(defined(invoker.sl_file_extension),
"The extension of the SL file must be specified (metal, glsl, etc..).")
flutter_spirv = invoker.shader_target_flag == "--flutter-spirv"
sksl = invoker.shader_target_flag == "--sksl"
if (!flutter_spirv) {
assert(
defined(invoker.sl_file_extension),
"The extension of the SL file must be specified (metal, glsl, etc..).")
}
iplr = false
if (defined(invoker.iplr) && invoker.iplr) {
iplr = invoker.iplr
@@ -291,10 +287,7 @@ template("impellerc") {
"$shader_target_flag",
]
if (flutter_spirv) {
args += [ "--spirv=$spirv_intermediate_path" ]
outputs = [ spirv_intermediate ]
} else if (sksl) {
if (sksl) {
sl_intermediate =
"$generated_dir/{{source_file_part}}.${invoker.sl_file_extension}"
sl_intermediate_path = rebase_path(sl_intermediate, root_build_dir)

View File

@@ -149,9 +149,6 @@ flutter:
uri: "../../../third_party/dart/sdk/lib/typed_data/typed_data.dart"
patches: "../../../third_party/dart/sdk/lib/_internal/vm/lib/typed_data_patch.dart"
_spirv:
uri: "../../lib/spirv/lib/spirv.dart"
ui:
uri: "../../lib/ui/ui.dart"

View File

@@ -1,75 +0,0 @@
# SPIR-V Transpiler
Note: This library is currently considered experimental until shader compilation is verified by engine unit tests, see the Testing section below for more details.
A dart library for transpiling a subset of SPIR-V to the shader languages used by Flutter internally.
- [SkSL](https://skia.org/docs/user/sksl/)
- [GLSL ES 100](https://www.khronos.org/files/opengles_shading_language.pdf)
- [GLSL ES 300](https://www.khronos.org/registry/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf)
All exported symbols are documented in `lib/spirv.dart`.
The supported subset of SPIR-V is specified in `lib/src/constants.dart`.
If you're using GLSL to generate SPIR-V with `glslangValidator` or `shaderc`,
the code will need to adhere to the following rules.
- There must be a single vec4 output at location 0.
- The output can only be written to from the main function.
- `gl_FragCoord` can only be read from the main function, and its z and w components
have no meaning.
- `if`, `else`, and `for` and function calls are the only permitted control
flow operations. `for` loops must initialize a float variable to a constant
value, compare it against a constant value, and increment/modify it by a
constant value.
- `while` and `switch` statements are not supported.
- No inputs from other shader stages.
- Only sampler2D, bool, float, float-vector types, and square float-matrix types.
- Only square matrices are supported.
- Only built-in functions present in GLSL ES 100 are used.
- Only the `texture` function is supported for sampling from a sampler2D object.
These rules may become less strict in future versions. Conformant SPIR-V should successfully transpile from the current version onwards. In other words, a SPIR-V shader you use now that meets these rules should keep working, but the output of the transpiler may change for that shader.
Support for control flow and structured types is planned but not currently included.
## Testing
### Exception Tests
These tests rely on the `.spvasm` (SPIR-V Assembly) and `.glsl` files contained under `test/exception_shaders` in this directory. They are compiled to binary SPIR-V using `spirv-asm`, from the SwiftShader dependency. They are tested by testing/dart/spirv_exception_test.dart as part of the normal suite of dart tests. The purpose of these tests is to exercise every explicit failure path for shader transpilation. Each `glsl` or `spvasm` file should include a comment describing the failure that it is testing. The given files should be valid apart from the single failure case they are testing.
To test the exception tests directly: `./testing/run_tests.py --type dart --dart-filter spirv_exception_test.dart`
### Pixel Tests
Pixel tests should run as part of unit-testing for each implementation of `dart:ui`. Currently, FragmentShader is only supported in C++. These tests aim to validate the correctness of transpilation to each target language. Each shader should render the color green for a correct transpilation, and any other color for failure. They will be a GLSL files that are compiled to SPIR-V via `shaderc`. Therefore, the `fragColor` should resolve to `vec4(0.0, 1.0, 0.0, 1.0)`
for all tests.
In each test, the uniform `a` is initialized with the value of 1.0.
This is important so that expressions are not simplified during GLSL to SPIR-V compilation, which may result in the removal of the op being tested.
To test the pixel tests directly: `./testing/run_tests.py --type dart --dart-filter fragment_shader_test.dart`
#### A Note on Test Isolation
Even the simplest GLSL program tests several instructions, so no test is completely isolated
to a single op. Also, some of the GLSL 450 op tests will use addition and subtraction, along with the
actual op being tested. However, the GLSL program for each test file is kept as simple as possible,
to satisfy these conditions: pass if the op works, and fail if the op does not work. In some tests,
it is sufficient to only call the GLSL op once, while other may need more calls to more completely
test the op. Many ops support scalars, vectors, or a combination as parameters. Most tests default
to using scalars as params, but vec2, vec3, and vec4 parameters are also tested.
- vec2 is tested as a parameter in glsl_op_normalize.glsl
- vec3 is tested as a parameter in glsl_op_cross.glsl
- vec4 is tested as a parameter in glsl_op_length.glsl
### Adding New Tests
To add a new test, add a glsl (fragment shader tests) or spvasm (spirv exception tests) src file to a `lib/spirv/test/` subfolder, and add the file as a source to the corresponding `BUILD.gn`.
- New files in `exception_shaders` are automatically tested in `testing/dart/spirv_exception_test`.
- New files in `supported_op_shaders` and `supported_glsl_op_shaders` are automatically tested in `testing/dart/fragment_shader_test`.
- New files in `general_shaders` are not automatically tested and must add a new manual test case in `testing/dart/fragment_shader_test`.

View File

@@ -1,79 +0,0 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// This library defines a transpiler for converting SPIR-V into SkSL or GLSL.
library spirv;
import 'dart:convert';
import 'dart:typed_data';
// These parts only contain private members, all public
// members are in this file (spirv.dart)
part 'src/constants.dart';
part 'src/function.dart';
part 'src/instructions.dart';
part 'src/transpiler.dart';
part 'src/types.dart';
/// The language to transpile to.
enum TargetLanguage {
/// SkSL, for Skia.
sksl,
/// GLSL ES 1.00, for WebGL 1.
glslES,
/// GLSL ES 3.00, for WebGL 2.
glslES300,
}
/// The result of a transpilation.
class TranspileResult {
/// Source code string in [language].
final String src;
/// The shader language in [src].
final TargetLanguage language;
/// The number of float uniforms used in this shader.
final int uniformFloatCount;
/// The number of samplers (children) used in this shader.
final int samplerCount;
TranspileResult._(
this.src,
this.uniformFloatCount,
this.samplerCount,
this.language,
);
}
/// Thrown during transpilation due to malformed or unsupported SPIR-V.
class TranspileException implements Exception {
/// The SPIR-V operator last read, or zero if there was none.
final int op;
/// Human readable message explaining the exception.
final String message;
@override
String toString() => '$op: $message';
TranspileException._(this.op, this.message);
}
/// Transpile the provided SPIR-V buffer into a string of the [target] lang.
/// Throws an instance of [TranspileException] for malformed or unsupported
/// SPIR-V.
TranspileResult transpile(ByteBuffer spirv, TargetLanguage target) {
final _Transpiler t = _Transpiler(spirv.asUint32List(), target);
t.transpile();
return TranspileResult._(
t.src.toString(),
t.uniformFloatCount,
t.samplerCount,
target,
);
}

View File

@@ -1,279 +0,0 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of spirv;
// This file contains a subset of SPIR-V constants defined at
// https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html
// Header constants
const int _magicNumber = 0x07230203;
// Supported ExecutionModes
const int _originLowerLeft = 8;
// Supported memory models
const int _addressingModelLogical = 0;
const int _memoryModelGLSL450 = 1;
// Supported capabilities
const int _capabilityMatrix = 0;
const int _capabilityShader = 1;
// Supported storage classes
const int _storageClassUniformConstant = 0;
const int _storageClassInput = 1;
const int _storageClassOutput = 3;
const int _storageClassFunction = 7;
// Explicity supported decorations, others are ignored
const int _decorationBuiltIn = 11;
const int _decorationLocation = 30;
// Explicitly supported builtin types
const int _builtinFragCoord = 15;
// Explicitly supported dimensionalities
const int _dim2D = 1;
// Ops that have no semantic meaning in output and can be safely ignored
const int _opSource = 3;
const int _opSourceExtension = 4;
const int _opName = 5;
const int _opMemberName = 6;
const int _opString = 7;
const int _opLine = 8;
// Supported instructions
const int _opExtInstImport = 11;
const int _opExtInst = 12;
const int _opMemoryModel = 14;
const int _opEntryPoint = 15;
const int _opExecutionMode = 16;
const int _opCapability = 17;
const int _opTypeVoid = 19;
const int _opTypeBool = 20;
const int _opTypeInt = 21;
const int _opTypeFloat = 22;
const int _opTypeVector = 23;
const int _opTypeMatrix = 24;
const int _opTypeImage = 25;
const int _opTypeSampledImage = 27;
const int _opTypePointer = 32;
const int _opTypeFunction = 33;
const int _opConstantTrue = 41;
const int _opConstantFalse = 42;
const int _opConstant = 43;
const int _opConstantComposite = 44;
const int _opFunction = 54;
const int _opFunctionParameter = 55;
const int _opFunctionEnd = 56;
const int _opFunctionCall = 57;
const int _opVariable = 59;
const int _opLoad = 61;
const int _opStore = 62;
const int _opAccessChain = 65;
const int _opDecorate = 71;
const int _opVectorShuffle = 79;
const int _opCompositeConstruct = 80;
const int _opCompositeExtract = 81;
const int _opImageSampleImplicitLod = 87;
const int _opConvertFToS = 110;
const int _opConvertSToF = 111;
const int _opFNegate = 127;
const int _opFAdd = 129;
const int _opFSub = 131;
const int _opFMul = 133;
const int _opFDiv = 136;
const int _opFMod = 141;
const int _opVectorTimesScalar = 142;
const int _opMatrixTimesScalar = 143;
const int _opVectorTimesMatrix = 144;
const int _opMatrixTimesVector = 145;
const int _opMatrixTimesMatrix = 146;
const int _opDot = 148;
const int _opFOrdEqual = 180;
const int _opFUnordNotEqual = 183;
const int _opFOrdLessThan = 184;
const int _opFOrdGreaterThan = 186;
const int _opFOrdLessThanEqual = 188;
const int _opFOrdGreaterThanEqual = 190;
const int _opLogicalEqual = 164;
const int _opLogicalNotEqual = 165;
const int _opLogicalOr = 166;
const int _opLogicalAnd = 167;
const int _opLogicalNot = 168;
const int _opSelect = 169;
const int _opLoopMerge = 246;
const int _opSelectionMerge = 247;
const int _opLabel = 248;
const int _opBranch = 249;
const int _opBranchConditional = 250;
const int _opReturn = 253;
const int _opReturnValue = 254;
// GLSL extension constants defined at
// https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html
// Supported GLSL extension name
const String _glslStd450 = 'GLSL.std.450';
// Supported GLSL ops
const int _glslStd450FAbs = 4;
const int _glslStd450FSign = 6;
const int _glslStd450Floor = 8;
const int _glslStd450Ceil = 9;
const int _glslStd450Fract = 10;
const int _glslStd450Radians = 11;
const int _glslStd450Degrees = 12;
const int _glslStd450Sin = 13;
const int _glslStd450Cos = 14;
const int _glslStd450Tan = 15;
const int _glslStd450Asin = 16;
const int _glslStd450Acos = 17;
const int _glslStd450Atan = 18;
const int _glslStd450Atan2 = 25;
const int _glslStd450Pow = 26;
const int _glslStd450Exp = 27;
const int _glslStd450Log = 28;
const int _glslStd450Exp2 = 29;
const int _glslStd450Log2 = 30;
const int _glslStd450Sqrt = 31;
const int _glslStd450InverseSqrt = 32;
const int _glslStd450FMin = 37;
const int _glslStd450FMax = 40;
const int _glslStd450FClamp = 43;
const int _glslStd450FMix = 46;
const int _glslStd450Step = 48;
const int _glslStd450SmoothStep = 49;
const int _glslStd450Length = 66;
const int _glslStd450Distance = 67;
const int _glslStd450Cross = 68;
const int _glslStd450Normalize = 69;
const int _glslStd450FaceForward = 70;
const int _glslStd450Reflect = 71;
const Map<int, String> _glslStd450OpNames = <int, String>{
_glslStd450FAbs: 'abs',
_glslStd450FSign: 'sign',
_glslStd450Floor: 'floor',
_glslStd450Ceil: 'ceil',
_glslStd450Fract: 'fract',
_glslStd450Radians: 'radians',
_glslStd450Degrees: 'degrees',
_glslStd450Sin: 'sin',
_glslStd450Cos: 'cos',
_glslStd450Tan: 'tan',
_glslStd450Asin: 'asin',
_glslStd450Acos: 'acos',
_glslStd450Atan: 'atan',
_glslStd450Atan2: 'atan2',
_glslStd450Pow: 'pow',
_glslStd450Exp: 'exp',
_glslStd450Log: 'log',
_glslStd450Exp2: 'exp2',
_glslStd450Log2: 'log2',
_glslStd450Sqrt: 'sqrt',
_glslStd450InverseSqrt: 'inversesqrt',
_glslStd450FMin: 'min',
_glslStd450FMax: 'max',
_glslStd450FClamp: 'clamp',
_glslStd450FMix: 'mix',
_glslStd450Step: 'step',
_glslStd450SmoothStep: 'smoothstep',
_glslStd450Length: 'length',
_glslStd450Distance: 'distance',
_glslStd450Cross: 'cross',
_glslStd450Normalize: 'normalize',
_glslStd450FaceForward: 'faceforward',
_glslStd450Reflect: 'reflect',
};
const Map<int, int> _glslStd450OpArgc = <int, int>{
_glslStd450FAbs: 1,
_glslStd450FSign: 1,
_glslStd450Floor: 1,
_glslStd450Ceil: 1,
_glslStd450Fract: 1,
_glslStd450Radians: 1,
_glslStd450Degrees: 1,
_glslStd450Sin: 1,
_glslStd450Cos: 1,
_glslStd450Tan: 1,
_glslStd450Asin: 1,
_glslStd450Acos: 1,
_glslStd450Atan: 1,
_glslStd450Atan2: 2,
_glslStd450Pow: 2,
_glslStd450Exp: 1,
_glslStd450Log: 1,
_glslStd450Exp2: 1,
_glslStd450Log2: 1,
_glslStd450Sqrt: 1,
_glslStd450InverseSqrt: 1,
_glslStd450FMin: 2,
_glslStd450FMax: 2,
_glslStd450FClamp: 3,
_glslStd450FMix: 3,
_glslStd450Step: 2,
_glslStd450SmoothStep: 3,
_glslStd450Length: 1,
_glslStd450Distance: 2,
_glslStd450Cross: 2,
_glslStd450Normalize: 1,
_glslStd450FaceForward: 3,
_glslStd450Reflect: 2,
};
enum _Operator {
addition,
subtraction,
division,
multiplication,
modulo,
negation,
equality,
inequality,
and,
or,
not,
lessThan,
greaterThan,
lessThanEqual,
greaterThanEqual,
}
const Set<_Operator> _compoundAssignmentOperators = <_Operator>{
_Operator.addition,
_Operator.subtraction,
_Operator.division,
_Operator.multiplication,
_Operator.modulo,
};
const Map<_Operator, String> _operatorStrings = <_Operator, String>{
_Operator.addition: '+',
_Operator.subtraction: '-',
_Operator.division: '/',
_Operator.multiplication: '*',
_Operator.modulo: '%',
_Operator.negation: '-',
_Operator.equality: '==',
_Operator.inequality: '!=',
_Operator.and: '&&',
_Operator.or: '||',
_Operator.not: '!',
_Operator.lessThan: '<',
_Operator.greaterThan: '>',
_Operator.lessThanEqual: '<=',
_Operator.greaterThanEqual: '>=',
};
String _operatorString(_Operator op) {
return _operatorStrings[op]!;
}
bool _isCompoundAssignment(_Operator op) {
return _compoundAssignmentOperators.contains(op);
}

View File

@@ -1,138 +0,0 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of spirv;
class _Variable {
_Variable(this.id, this.type);
final int id;
final int type;
bool initialized = false;
int liftToBlock = 0;
}
class _Function {
_Function(this.transpiler, this.type, this.name)
: params = List<int>.filled(type.params.length, 0);
final _Transpiler transpiler;
final int name;
final _FunctionType type;
final List<int> params;
// entry point for the function
_Block? entry;
// The number of parameters declared so far.
int declaredParams = 0;
final Map<int, _Block> blocks = <int, _Block>{};
final List<int> deps = <int>[];
final Map<int, _Variable> variables = <int, _Variable>{};
_Block addBlock(int id) {
final _Block b = _Block(id, this);
blocks[id] = b;
entry ??= b;
return b;
}
_Block block(int id) {
return blocks[id]!;
}
void declareVariable(int id, int type) {
variables[id] = _Variable(id, type);
}
_Variable? variable(int id) {
return variables[id];
}
void declareParam(int id, int paramType) {
final int i = declaredParams;
if (paramType != type.params[i]) {
throw TranspileException._(
_opFunctionParameter, 'type mismatch for param $i of function $name');
}
params[i] = id;
declaredParams++;
}
/// Returns deps of result `id` that are variables.
List<_Variable> variableDeps(int id) {
final _Instruction? result = transpiler.results[id];
if (result == null) {
return <_Variable>[];
}
final Set<int> deps = <int>{};
transpiler.collectDeps(deps, id);
return deps
.where(variables.containsKey)
.map((int id) => variables[id]!)
.toList();
}
void write(StringBuffer out) {
if (declaredParams != params.length) {
throw transpiler
.failure('not all parameters declared for function $name');
}
if (entry == null) {
throw transpiler.failure('function $name has no entry block');
}
String returnTypeString = transpiler.resolveType(type.returnType);
if (transpiler.target == TargetLanguage.sksl &&
name == transpiler.entryPoint) {
returnTypeString = 'half4';
}
final String nameString = transpiler.resolveName(name);
out.write('$returnTypeString $nameString(');
if (transpiler.target == TargetLanguage.sksl &&
name == transpiler.entryPoint) {
const String fragParam = 'float2 $_fragParamName';
out.write(fragParam);
}
for (int i = 0; i < params.length; i++) {
final String typeString = transpiler.resolveType(type.params[i]);
final String nameString = transpiler.resolveName(params[i]);
out.write('$typeString $nameString');
if (i < params.length - 1) {
out.write(', ');
}
}
out.writeln(') {');
// SkSL needs to return a value from main, so we maintain a variable
// that receives the value of gl_FragColor and returns it at the end.
if (transpiler.target == TargetLanguage.sksl &&
name == transpiler.entryPoint) {
if (transpiler.fragCoord > 0) {
final String fragName = transpiler.resolveName(transpiler.fragCoord);
out.writeln(' float4 $fragName = float4($_fragParamName, 0, 0);');
}
out.writeln(' float4 $_colorVariableName;');
}
entry?._preprocess();
// write the actual function body
entry?.write(_BlockContext(
out: out,
indent: 1,
));
if (transpiler.target == TargetLanguage.sksl &&
name == transpiler.entryPoint) {
out.writeln(' return $_colorVariableName;');
}
out.writeln('}');
out.writeln();
}
}

View File

@@ -1,663 +0,0 @@
part of spirv;
class _BlockContext {
_BlockContext({
required this.out,
required this.indent,
this.merge = 0,
this.continueBlock = 0,
this.loopHeader = 0,
this.loopMerge = 0,
});
final StringBuffer out;
final int indent;
/// The most local merge block id, or zero.
final int merge;
/// The most local continue block id, or zero.
final int continueBlock;
/// The most local loop-construct header block id.
final int loopHeader;
/// The most local loop-construct merge block id.
/// This is different from [merge] when the context is inside an if-statement
/// inside of a for-loop, for example.
final int loopMerge;
/// Return a new [_BlockContext] that is a copy of the current [_BlockContext]
/// with an increased indent and any parameters specified here overwritten.
_BlockContext child({
int? merge,
int? continueBlock,
int? loopHeader,
int? loopMerge,
}) =>
_BlockContext(
out: out,
indent: indent + 1,
merge: merge ?? this.merge,
continueBlock: continueBlock ?? this.continueBlock,
loopHeader: loopHeader ?? this.loopHeader,
loopMerge: loopMerge ?? this.loopMerge,
);
void writeIndent() {
out.write(' ' * indent);
}
}
class _Block {
_Block(this.id, this.function);
final int id;
final _Function function;
List<_Instruction> instructions = <_Instruction>[];
// control flow
int branch = 0;
int mergeBlock = 0;
int condition = 0;
int truthyBlock = 0;
int falseyBlock = 0;
// structured loop
_Store? loopInitializer;
int continueBlock = 0;
// true if this block has been processed by [liftLoopVariables].
bool scanned = false;
_Transpiler get transpiler => function.transpiler;
bool get hasSelectionStructure => mergeBlock != 0 && continueBlock == 0;
bool get hasLoopStructure => continueBlock != 0;
void _add(_Instruction i) {
instructions.add(i);
}
void _writeContinue(_BlockContext ctx) {
final List<_CompoundAssignment> assignments =
instructions.whereType<_CompoundAssignment>().toList();
if (assignments.isEmpty) {
throw TranspileException._(
_opLoopMerge, 'loop continue block $id has no compound assignments.');
}
if (assignments.length > 1) {
throw TranspileException._(_opLoopMerge,
'loop continue block $id has multiple compound assignments.');
}
assignments[0].write(transpiler, ctx.out);
}
void write(_BlockContext ctx) {
for (final _Instruction inst in instructions) {
if (inst is _Store) {
final _Variable? v = function.variables[inst.pointer];
if (v != null && inst.shouldDeclare && v.liftToBlock != 0) {
function.block(v.liftToBlock).loopInitializer = inst;
continue;
}
}
if (!inst.isResult) {
ctx.writeIndent();
inst.write(transpiler, ctx.out);
ctx.out.writeln(';');
} else if (inst.refCount > 1) {
ctx.writeIndent();
final String typeString = transpiler.resolveType(inst.type);
final String nameString = transpiler.resolveName(inst.id);
ctx.out.write('$typeString $nameString = ');
inst.write(transpiler, ctx.out);
ctx.out.writeln(';');
}
}
if (hasSelectionStructure) {
_writeSelectionStructure(ctx);
} else if (hasLoopStructure) {
_writeLoopStructure(ctx);
}
if (mergeBlock != 0) {
function.block(mergeBlock).write(ctx);
} else if (branch != 0) {
if (branch == ctx.merge) {
return;
}
if (branch == ctx.continueBlock) {
if (ctx.merge != ctx.loopMerge) {
ctx.writeIndent();
ctx.out.writeln('continue;');
}
return;
}
if (branch == ctx.loopMerge) {
ctx.writeIndent();
ctx.out.writeln('break;');
}
function.block(branch).write(ctx);
}
}
/// Scans through the entire Control-Flow graph to collecting parts of
/// for-loop structures.
void _preprocess() {
if (scanned) {
return;
}
scanned = true;
// SkSL has specific needs for for-loops - they must define a single
// index variable to a constant value, they must compare that value
// against a constant value, and they must be modified in place with
// a constant value. SPIR-V represents all these operations in different
// blocks, so we scan here to collect them so they can be written together.
if (hasLoopStructure) {
int conditionId = condition;
if (condition == 0) {
final _Block branchBlock = function.block(branch);
if (!branchBlock._isSimple() || branchBlock.condition == 0) {
throw TranspileException._(
_opBranch,
'block $id has a loop structure but does not immediately '
'branch to a single-expression conditional block.');
}
conditionId = branchBlock.condition;
}
final List<_Variable> deps = function.variableDeps(conditionId);
if (deps.length != 1) {
throw TranspileException._(
_opLoopMerge,
'block $id has a loop structure with a condition '
'using more or fewer than one local variable.');
}
deps[0].liftToBlock = id;
}
// Scan all blocks that can be reached from this block.
if (branch != 0) {
function.block(branch)._preprocess();
}
if (condition != 0) {
if (truthyBlock != 0) {
function.block(truthyBlock)._preprocess();
}
if (falseyBlock != 0) {
function.block(falseyBlock)._preprocess();
}
}
if (mergeBlock != 0) {
function.block(mergeBlock)._preprocess();
}
}
void _writeSelectionStructure(_BlockContext ctx) {
final _BlockContext childCtx = ctx.child(merge: mergeBlock);
ctx.writeIndent();
final String conditionString = transpiler.resolveResult(condition);
ctx.out.writeln('if ($conditionString) {');
function.block(truthyBlock).write(childCtx);
if (falseyBlock != 0 && falseyBlock != mergeBlock) {
ctx.writeIndent();
ctx.out.writeln('} else {');
function.block(falseyBlock).write(childCtx);
}
ctx.writeIndent();
ctx.out.writeln('}');
}
void _writeLoopStructure(_BlockContext ctx) {
final _BlockContext childCtx = ctx.child(
merge: mergeBlock,
continueBlock: continueBlock,
loopHeader: id,
loopMerge: mergeBlock,
);
String conditionString;
int loopBody = 0;
if (condition != 0) {
conditionString = transpiler.resolveResult(condition);
if (truthyBlock == mergeBlock) {
conditionString = '!' + conditionString;
loopBody = falseyBlock;
} else if (falseyBlock == mergeBlock) {
loopBody = truthyBlock;
}
} else {
final _Block branchBlock = function.block(branch);
if (!branchBlock._isSimple() || branchBlock.condition == 0) {
throw TranspileException._(
_opBranch,
'block $id has a loop structure but does not immediately '
'branch to a single-expression conditional block.');
}
conditionString = transpiler.resolveResult(branchBlock.condition);
if (branchBlock.truthyBlock == mergeBlock) {
conditionString = '!' + conditionString;
loopBody = branchBlock.falseyBlock;
} else if (branchBlock.falseyBlock == mergeBlock) {
loopBody = branchBlock.truthyBlock;
}
}
if (loopBody == 0) {
throw TranspileException._(
_opLoopMerge,
'block $id does not conditionally branch to its '
'loop merge block.');
}
ctx.writeIndent();
ctx.out.write('for(');
loopInitializer!.write(transpiler, ctx.out);
ctx.out.write('; ');
ctx.out.write(conditionString);
ctx.out.write('; ');
function.block(continueBlock)._writeContinue(ctx);
ctx.out.writeln(') {');
function.block(loopBody).write(childCtx);
ctx.writeIndent();
ctx.out.writeln('}');
}
/// Returns true if this block has no stateful expressions
/// and can be written as a single expression.
bool _isSimple() {
int statements = 0;
for (final _Instruction inst in instructions) {
if (!inst.isResult) {
return false;
}
if (inst.refCount > 1) {
statements++;
}
}
return statements == 0;
}
}
abstract class _Instruction {
int get type => 0;
int get id => 0;
bool get isResult => id != 0;
List<int> get deps => <int>[];
// How many times this instruction is referenced, a value
// of 2 or greater means that it will be stored into a variable.
int refCount = 0;
void write(_Transpiler t, StringBuffer out);
}
class _FunctionCall extends _Instruction {
_FunctionCall(this.type, this.id, this.function, this.args);
@override
final int type;
@override
final int id;
final String function;
final List<int> args;
@override
List<int> get deps => args;
@override
void write(_Transpiler t, StringBuffer out) {
out.write('$function(');
for (int i = 0; i < args.length; i++) {
out.write(t.resolveResult(args[i]));
if (i < args.length - 1) {
out.write(', ');
}
}
out.write(')');
}
}
class _Return extends _Instruction {
@override
void write(_Transpiler t, StringBuffer out) {
out.write('return');
}
}
class _Select extends _Instruction {
_Select(this.type, this.id, this.condition, this.a, this.b);
@override
final int type;
@override
final int id;
final int condition;
final int a;
final int b;
@override
List<int> get deps => <int>[condition, a, b];
@override
void write(_Transpiler t, StringBuffer out) {
final String aName = t.resolveResult(a);
final String bName = t.resolveResult(b);
final String conditionName = t.resolveResult(condition);
out.write('$conditionName ? $aName : $bName');
}
}
class _CompoundAssignment extends _Instruction {
_CompoundAssignment(this.pointer, this.op, this.object);
final int pointer;
final _Operator op;
final int object;
@override
void write(_Transpiler t, StringBuffer out) {
final String pointerName = t.resolveResult(pointer);
final String objectName = t.resolveResult(object);
final String operatorString = _operatorString(op);
out.write('$pointerName $operatorString= $objectName');
}
}
class _Store extends _Instruction {
_Store(
this.pointer,
this.object, {
this.shouldDeclare = false,
this.declarationType = 0,
});
final int pointer;
final int object;
final bool shouldDeclare;
final int declarationType;
int selfModifyObject = 0;
String selfModifyOperator = '';
@override
List<int> get deps => <int>[pointer, object];
@override
void write(_Transpiler t, StringBuffer out) {
final String pointerName = t.resolveResult(pointer);
if (selfModifyObject > 0) {
final String objectName = t.resolveResult(selfModifyObject);
out.write('$pointerName $selfModifyOperator $objectName');
} else {
final String objectName = t.resolveResult(object);
if (shouldDeclare) {
final String typeString = t.resolveType(declarationType);
out.write('$typeString ');
}
out.write('$pointerName = $objectName');
}
}
}
class _AccessChain extends _Instruction {
_AccessChain(this.type, this.id, this.base, this.indices);
@override
final int type;
@override
final int id;
final int base;
final List<int> indices;
@override
List<int> get deps => <int>[base, ...indices];
@override
void write(_Transpiler t, StringBuffer out) {
out.write(t.resolveResult(base));
for (int i = 0; i < indices.length; i++) {
final String indexString = t.resolveResult(indices[i]);
out.write('[$indexString]');
}
}
}
class _VectorShuffle extends _Instruction {
_VectorShuffle(this.type, this.id, this.vector, this.indices);
@override
final int type;
@override
final int id;
final int vector;
final List<int> indices;
@override
List<int> get deps => <int>[vector];
@override
void write(_Transpiler t, StringBuffer out) {
final String typeString = t.resolveType(type);
final String vectorString = t.resolveName(vector);
out.write('$typeString(');
for (int i = 0; i < indices.length; i++) {
final int index = indices[i];
out.write('$vectorString[$index]');
if (i < indices.length - 1) {
out.write(', ');
}
}
out.write(')');
}
}
class _CompositeConstruct extends _Instruction {
_CompositeConstruct(this.type, this.id, this.components);
@override
final int type;
@override
final int id;
final List<int> components;
@override
List<int> get deps => components;
@override
void write(_Transpiler t, StringBuffer out) {
final String typeString = t.resolveType(type);
out.write('$typeString(');
for (int i = 0; i < components.length; i++) {
out.write(t.resolveResult(components[i]));
if (i < components.length - 1) {
out.write(', ');
}
}
out.write(')');
}
}
class _CompositeExtract extends _Instruction {
_CompositeExtract(this.type, this.id, this.src, this.indices);
@override
final int type;
@override
final int id;
final int src;
final List<int> indices;
@override
List<int> get deps => <int>[src];
@override
void write(_Transpiler t, StringBuffer out) {
out.write(t.resolveResult(src));
for (int i = 0; i < indices.length; i++) {
out.write('[${indices[i]}]');
}
}
}
class _ImageSampleImplicitLod extends _Instruction {
_ImageSampleImplicitLod(
this.type, this.id, this.sampledImage, this.coordinate);
@override
final int type;
@override
final int id;
final int sampledImage;
final int coordinate;
@override
List<int> get deps => <int>[coordinate];
@override
void write(_Transpiler t, StringBuffer out) {
final String sampledImageString = t.resolveName(sampledImage);
final String coordinateString = t.resolveResult(coordinate);
if (t.target == TargetLanguage.sksl) {
out.write(
'$sampledImageString.eval(${sampledImageString}_size * $coordinateString)');
} else {
out.write('texture($sampledImageString, $coordinateString)');
}
}
}
class _UnaryOperator extends _Instruction {
_UnaryOperator(this.type, this.id, this.op, this.operand);
@override
final int type;
@override
final int id;
final _Operator op;
final int operand;
@override
List<int> get deps => <int>[operand];
@override
void write(_Transpiler t, StringBuffer out) {
out.write(_operatorString(op));
out.write(t.resolveResult(operand));
}
}
class _ReturnValue extends _Instruction {
_ReturnValue(this.value);
final int value;
@override
List<int> get deps => <int>[value];
@override
void write(_Transpiler t, StringBuffer out) {
final String valueString = t.resolveResult(value);
out.write('return $valueString');
}
}
class _BinaryOperator extends _Instruction {
_BinaryOperator(this.type, this.id, this.op, this.a, this.b);
@override
final int type;
@override
final int id;
final _Operator op;
final int a;
final int b;
@override
List<int> get deps => <int>[a, b];
@override
void write(_Transpiler t, StringBuffer out) {
final String aStr = t.resolveResult(a);
final String bStr = t.resolveResult(b);
final String opString = _operatorString(op);
out.write('$aStr $opString $bStr');
}
}
class _BuiltinFunction extends _Instruction {
_BuiltinFunction(this.type, this.id, this.function, this.args);
@override
final int type;
@override
final int id;
final String function;
final List<int> args;
@override
List<int> get deps => args;
@override
void write(_Transpiler t, StringBuffer out) {
out.write('$function(');
for (int i = 0; i < args.length; i++) {
out.write(t.resolveResult(args[i]));
if (i < args.length - 1) {
out.write(', ');
}
}
out.write(')');
}
}
class _TypeCast extends _Instruction {
_TypeCast(this.type, this.id, this.value);
@override
final int type;
@override
final int id;
final int value;
@override
List<int> get deps => <int>[value];
@override
void write(_Transpiler t, StringBuffer out) {
final String typeString = t.resolveType(type);
final String valueString = t.resolveResult(value);
out.write('$typeString($valueString)');
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,76 +0,0 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of spirv;
enum _Type {
_void,
_bool,
_int,
float,
float2,
float3,
float4,
float2x2,
float3x3,
float4x4,
sampledImage,
}
class _FunctionType {
/// Result-id of the return type.
final int returnType;
/// Type-id for each parameter.
final List<int> params;
_FunctionType(this.returnType, this.params);
}
String _typeName(_Type t, TargetLanguage target) {
switch (target) {
case TargetLanguage.sksl:
return _skslTypeNames[t]!;
default:
return _glslTypeNames[t]!;
}
}
const Map<_Type, String> _skslTypeNames = <_Type, String>{
_Type._void: 'void',
_Type._bool: 'bool',
_Type._int: 'int',
_Type.float: 'float',
_Type.float2: 'float2',
_Type.float3: 'float3',
_Type.float4: 'float4',
_Type.float2x2: 'float2x2',
_Type.float3x3: 'float3x3',
_Type.float4x4: 'float4x4',
_Type.sampledImage: 'shader',
};
const Map<_Type, String> _glslTypeNames = <_Type, String>{
_Type._void: 'void',
_Type._bool: 'bool',
_Type._int: 'int',
_Type.float: 'float',
_Type.float2: 'vec2',
_Type.float3: 'vec3 ',
_Type.float4: 'vec4',
_Type.float2x2: 'mat2',
_Type.float3x3: 'mat3',
_Type.float4x4: 'mat4',
_Type.sampledImage: 'sampler2D',
};
const Map<_Type, int> _typeFloatCounts = <_Type, int>{
_Type.float: 1,
_Type.float2: 2,
_Type.float3: 3,
_Type.float4: 4,
_Type.float2x2: 4,
_Type.float3x3: 9,
_Type.float4x4: 16,
};

View File

@@ -1,9 +0,0 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
name: spirv
publish_to: none
environment:
sdk: '>=2.12.0 <3.0.0'

View File

@@ -1,62 +0,0 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/impeller/tools/impeller.gni")
import("//flutter/testing/testing.gni")
if (enable_unittests) {
executable("spirv_assembler") {
include_dirs = [ "//third_party/vulkan-deps/spirv-tools/src/include/" ]
sources = [ "spirv_assembler.cc" ]
configs +=
[ "//third_party/vulkan-deps/spirv-tools/src:spvtools_public_config" ]
deps = [
"//third_party/vulkan-deps/spirv-tools/src:spvtools",
"//third_party/vulkan-deps/spirv-tools/src:spvtools_val",
]
}
group("test") {
testonly = true
deps = [
":fixtures",
":sksl_ink_sparkle",
":spirv_ink_sparkle",
"//flutter/lib/spirv/test/exception_shaders:spirv_compile_exception_shaders",
"//flutter/lib/spirv/test/general_shaders",
"//flutter/lib/spirv/test/supported_glsl_op_shaders",
"//flutter/lib/spirv/test/supported_op_shaders",
]
}
impellerc("spirv_ink_sparkle") {
shaders = [ "//flutter/impeller/fixtures/ink_sparkle.frag" ]
shader_target_flag = "--flutter-spirv"
intermediates_subdir = "spirv"
}
impellerc("sksl_ink_sparkle") {
shaders = [ "//flutter/impeller/fixtures/ink_sparkle.frag" ]
shader_target_flag = "--sksl"
intermediates_subdir = "sksl"
sl_file_extension = "sksl"
}
impellerc("iplr_ink_sparkle") {
shaders = [ "//flutter/impeller/fixtures/ink_sparkle.frag" ]
shader_target_flag = "--sksl"
intermediates_subdir = "iplr"
sl_file_extension = "iplr"
iplr = true
}
test_fixtures("fixtures") {
deps = [ ":iplr_ink_sparkle" ]
fixtures = get_target_outputs(":iplr_ink_sparkle")
dest = "$root_gen_dir/flutter/lib/ui"
}
}

View File

@@ -2,52 +2,5 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/compiled_action.gni")
import("//flutter/testing/testing.gni")
if (enable_unittests) {
compiled_action_foreach("spirv_compile_exception_shaders") {
tool = "//flutter/lib/spirv/test:spirv_assembler"
sources = [
"for_loop_does_not_branch_to_conditional.spvasm",
"for_loop_does_not_branch_to_merge.spvasm",
"image_type_arrayed_must_be_zero.spvasm",
"image_type_depth_must_be_zero.spvasm",
"image_type_dimensionality_must_be_2D.spvasm",
"image_type_multisampled_must_be_zero.spvasm",
"image_type_must_be_float.spvasm",
"image_type_previously_declared.spvasm",
"image_type_sampled_must_be_one.spvasm",
"multiple_statements_in_for_loop_continue_block.spvasm",
"multiple_variables_in_for_loop_comparison.spvasm",
"no_store_in_for_loop_continue.spvasm",
"sampled_image_type_image_type_not_declared.spvasm",
"sampled_image_type_invalid_image_type.spvasm",
"sampled_image_type_previously_declared.spvasm",
"unassigned_function_type.spvasm",
"unassigned_pointer_type.spvasm",
"unassigned_type.spvasm",
"unassigned_variable_type.spvasm",
"unsupported_addressing_model.spvasm",
"unsupported_capability.spvasm",
"unsupported_execution_mode.spvasm",
"unsupported_ext_inst_import.spvasm",
"unsupported_float_width.spvasm",
"unsupported_glsl_inst.spvasm",
"unsupported_matrix_column_count.spvasm",
"unsupported_matrix_non_square.spvasm",
"unsupported_memory_model.spvasm",
"unsupported_variable_storage_class.spvasm",
"unsupported_vector_component_count.spvasm",
"unsupported_vector_type.spvasm",
]
outputs = [ "$target_gen_dir/{{source_name_part}}.spv" ]
args = [
"{{source}}",
rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.spv",
]
}
group("spirv_compile_exception_shaders") {
}

View File

@@ -1,74 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 38
; Schema: 0
;
; Block %14 branches unconditionally to a block with no conditional-branch
; despite declaring a LoopMerge.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %oColor "oColor"
OpName %i "i"
OpName %a "a"
OpDecorate %oColor Location 0
OpDecorate %a Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%_ptr_Function_float = OpTypePointer Function %float
%float_10 = OpConstant %float 10
%bool = OpTypeBool
%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float
%a = OpVariable %_ptr_UniformConstant_float UniformConstant
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Output_float = OpTypePointer Output %float
%float_1 = OpConstant %float 1
%uint_3 = OpConstant %uint 3
%main = OpFunction %void None %3
%5 = OpLabel
%i = OpVariable %_ptr_Function_float Function
OpStore %oColor %11
OpStore %i %float_0
OpBranch %14
%14 = OpLabel
OpLoopMerge %16 %17 None
OpBranch %16
%18 = OpLabel
%19 = OpLoad %float %i
%22 = OpFOrdLessThan %bool %19 %float_10
OpBranchConditional %22 %15 %16
%15 = OpLabel
%25 = OpLoad %float %a
%29 = OpAccessChain %_ptr_Output_float %oColor %uint_0
%30 = OpLoad %float %29
%31 = OpFAdd %float %30 %25
%32 = OpAccessChain %_ptr_Output_float %oColor %uint_0
OpStore %32 %31
OpBranch %17
%17 = OpLabel
%33 = OpLoad %float %i
%35 = OpFAdd %float %33 %float_1
OpStore %i %35
OpBranch %14
%16 = OpLabel
%37 = OpAccessChain %_ptr_Output_float %oColor %uint_3
OpStore %37 %float_1
OpReturn
OpFunctionEnd

View File

@@ -1,74 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 38
; Schema: 0
;
; The conditional following the LoopMerge on line 56 does not branch
; to the loop merge block %16.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %oColor "oColor"
OpName %i "i"
OpName %a "a"
OpDecorate %oColor Location 0
OpDecorate %a Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%_ptr_Function_float = OpTypePointer Function %float
%float_10 = OpConstant %float 10
%bool = OpTypeBool
%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float
%a = OpVariable %_ptr_UniformConstant_float UniformConstant
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Output_float = OpTypePointer Output %float
%float_1 = OpConstant %float 1
%uint_3 = OpConstant %uint 3
%main = OpFunction %void None %3
%5 = OpLabel
%i = OpVariable %_ptr_Function_float Function
OpStore %oColor %11
OpStore %i %float_0
OpBranch %14
%14 = OpLabel
OpLoopMerge %16 %17 None
OpBranch %18
%18 = OpLabel
%19 = OpLoad %float %i
%22 = OpFOrdLessThan %bool %19 %float_10
OpBranchConditional %22 %15 %17
%15 = OpLabel
%25 = OpLoad %float %a
%29 = OpAccessChain %_ptr_Output_float %oColor %uint_0
%30 = OpLoad %float %29
%31 = OpFAdd %float %30 %25
%32 = OpAccessChain %_ptr_Output_float %oColor %uint_0
OpStore %32 %31
OpBranch %17
%17 = OpLabel
%33 = OpLoad %float %i
%35 = OpFAdd %float %33 %float_1
OpStore %i %35
OpBranch %14
%16 = OpLabel
%37 = OpAccessChain %_ptr_Output_float %oColor %uint_3
OpStore %37 %float_1
OpReturn
OpFunctionEnd

View File

@@ -1,62 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 28
; Schema: 0
;
; Line 43 contains a non-zero-arrayed image type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 2D 0 1 0 1 Unknown
%22 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,62 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 28
; Schema: 0
;
; Line 43 contains a non-zero-depth image type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 2D 1 0 0 1 Unknown
%22 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,61 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 28
; Schema: 0
;
; Line 43 contains a non-2D image type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 3D 0 0 0 1 Unknown
%22 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,61 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 28
; Schema: 0
;
; Line 43 contains a non-zero-multisampled image type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 2D 0 0 1 1 Unknown
%22 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,61 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 28
; Schema: 0
;
; Line 43 contains a non-float image type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %void 2D 0 0 0 1 Unknown
%22 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,62 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 29
; Schema: 0
;
; Line 45 contains a second OpTypeImage declaration.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 2D 0 0 0 1 Unknown
%28 = OpTypeImage %float 2D 0 0 0 1 Unknown
%22 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,63 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 28
; Schema: 0
;
; Line 43 contains an image type with 'sampled' not set to one.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 2D 0 0 0 0 Unknown
%22 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,76 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 39
; Schema: 0
;
; Continue block %18 contains more than one OpStore instruction.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %oColor "oColor"
OpName %j "j"
OpName %i "i"
OpName %a "a"
OpDecorate %oColor Location 0
OpDecorate %a Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%_ptr_Function_float = OpTypePointer Function %float
%float_10 = OpConstant %float 10
%bool = OpTypeBool
%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float
%a = OpVariable %_ptr_UniformConstant_float UniformConstant
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Output_float = OpTypePointer Output %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %3
%5 = OpLabel
%j = OpVariable %_ptr_Function_float Function
%i = OpVariable %_ptr_Function_float Function
OpStore %oColor %11
OpStore %j %float_0
OpStore %i %float_0
OpBranch %15
%15 = OpLabel
OpLoopMerge %17 %18 None
OpBranch %19
%19 = OpLabel
%20 = OpLoad %float %i
%23 = OpFOrdLessThan %bool %20 %float_10
OpBranchConditional %23 %16 %17
%16 = OpLabel
%26 = OpLoad %float %a
%30 = OpAccessChain %_ptr_Output_float %oColor %uint_0
%31 = OpLoad %float %30
%32 = OpFAdd %float %31 %26
%33 = OpAccessChain %_ptr_Output_float %oColor %uint_0
OpStore %33 %32
OpBranch %18
%18 = OpLabel
%34 = OpLoad %float %i
%36 = OpFAdd %float %34 %float_1
OpStore %i %36
%37 = OpLoad %float %j
%38 = OpFAdd %float %37 %float_1
OpStore %j %38
OpBranch %15
%17 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,78 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 41
; Schema: 0
;
; Condition %27 depends on more than one variable, but is used as a for-loop
; condition.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %oColor "oColor"
OpName %i "i"
OpName %j "j"
OpName %a "a"
OpDecorate %oColor Location 0
OpDecorate %a Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%_ptr_Function_float = OpTypePointer Function %float
%float_10 = OpConstant %float 10
%bool = OpTypeBool
%float_5 = OpConstant %float 5
%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float
%a = OpVariable %_ptr_UniformConstant_float UniformConstant
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Output_float = OpTypePointer Output %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %3
%5 = OpLabel
%i = OpVariable %_ptr_Function_float Function
%j = OpVariable %_ptr_Function_float Function
OpStore %oColor %11
OpStore %i %float_0
OpStore %j %float_0
OpBranch %15
%15 = OpLabel
OpLoopMerge %17 %18 None
OpBranch %19
%19 = OpLabel
%20 = OpLoad %float %i
%23 = OpFOrdLessThan %bool %20 %float_10
%24 = OpLoad %float %j
%26 = OpFOrdLessThan %bool %24 %float_5
%27 = OpLogicalAnd %bool %23 %26
OpBranchConditional %27 %16 %17
%16 = OpLabel
%30 = OpLoad %float %a
%34 = OpAccessChain %_ptr_Output_float %oColor %uint_0
%35 = OpLoad %float %34
%36 = OpFAdd %float %35 %30
%37 = OpAccessChain %_ptr_Output_float %oColor %uint_0
OpStore %37 %36
OpBranch %18
%18 = OpLabel
%38 = OpLoad %float %i
%40 = OpFAdd %float %38 %float_1
OpStore %i %40
OpBranch %15
%17 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,66 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 33
; Schema: 0
;
; Continue block %17 has no OpStore instruction.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %oColor "oColor"
OpName %i "i"
OpName %a "a"
OpDecorate %oColor Location 0
OpDecorate %a Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%_ptr_Function_float = OpTypePointer Function %float
%float_10 = OpConstant %float 10
%bool = OpTypeBool
%_ptr_UniformConstant_float = OpTypePointer UniformConstant %float
%a = OpVariable %_ptr_UniformConstant_float UniformConstant
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Output_float = OpTypePointer Output %float
%main = OpFunction %void None %3
%5 = OpLabel
%i = OpVariable %_ptr_Function_float Function
OpStore %oColor %11
OpStore %i %float_0
OpBranch %14
%14 = OpLabel
OpLoopMerge %16 %17 None
OpBranch %18
%18 = OpLabel
%19 = OpLoad %float %i
%22 = OpFOrdLessThan %bool %19 %float_10
OpBranchConditional %22 %15 %16
%15 = OpLabel
%25 = OpLoad %float %a
%29 = OpAccessChain %_ptr_Output_float %oColor %uint_0
%30 = OpLoad %float %29
%31 = OpFAdd %float %30 %25
%32 = OpAccessChain %_ptr_Output_float %oColor %uint_0
OpStore %32 %31
OpBranch %17
%17 = OpLabel
OpBranch %14
%16 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -1,63 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 29
; Schema: 0
;
; Line 43 contains an OpTypeSampledImage before OpImageType has been declared.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%22 = OpTypeSampledImage %21
%21 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,62 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 29
; Schema: 0
;
; Line 44 contains an OpTypeSampledImage with an invalid image type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 2D 0 0 0 1 Unknown
%22 = OpTypeSampledImage %float
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,62 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 29
; Schema: 0
;
; Line 45 contains a second OpTypeSampledImage declaration.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %oColor
OpExecutionMode %main OriginLowerLeft
OpSource GLSL 450
OpName %main "main"
OpName %uv "uv"
OpName %gl_FragCoord "gl_FragCoord"
OpName %iResolution "iResolution"
OpName %oColor "oColor"
OpName %iImage "iImage"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %iResolution Location 1
OpDecorate %oColor Location 0
OpDecorate %iImage Location 0
OpDecorate %iImage DescriptorSet 0
OpDecorate %iImage Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%_ptr_UniformConstant_v2float = OpTypePointer UniformConstant %v2float
%iResolution = OpVariable %_ptr_UniformConstant_v2float UniformConstant
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%21 = OpTypeImage %float 2D 0 0 0 1 Unknown
%22 = OpTypeSampledImage %21
%28 = OpTypeSampledImage %21
%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
%iImage = OpVariable %_ptr_UniformConstant_22 UniformConstant
%main = OpFunction %void None %3
%5 = OpLabel
%uv = OpVariable %_ptr_Function_v2float Function
%13 = OpLoad %v4float %gl_FragCoord
%14 = OpVectorShuffle %v2float %13 %13 0 1
%17 = OpLoad %v2float %iResolution
%18 = OpFDiv %v2float %14 %17
OpStore %uv %18
%25 = OpLoad %22 %iImage
%26 = OpLoad %v2float %uv
%27 = OpImageSampleImplicitLod %v4float %25 %26
OpStore %oColor %27
OpReturn
OpFunctionEnd

View File

@@ -1,13 +0,0 @@
#version 450
layout (location = 0) out vec4 oColor;
layout (location = 0) uniform float a;
void main() {
oColor = vec4(0);
for (float i = 0; i < 10.0; i++) {
oColor.r += a;
}
oColor.a = 1.0;
}

View File

@@ -1,35 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 13
; Schema: 0
;
; OpFunction is called with an unassigned type on line 27.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %13
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,37 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 14
; Schema: 0
;
; ID %13 is assigned a pointer type with an undefined underlying
; type %14. Line 20.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%13 = OpTypePointer Output %14
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,36 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 13
; Schema: 0
;
; In the definition of %main, %void has been replaced with an undefined
; ID, representing an undefined type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %13 None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,37 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; Line 24 calls OpVariable to create a UniformConstant variable with an
; undefined type.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%14 = OpVariable %13 UniformConstant
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,36 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; OpMemoryModel is called with a non 'Logical' value, here
; Physical32 is used instead.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Physical32 GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,36 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; A capability not in the set of {Matrix, Shader} is used.
;
OpCapability Shader
OpCapability Geometry
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,36 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; OpExecutionMode is called with a non 'OriginLowerLeft' value, here
; PointMode is used instead.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main PointMode
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,36 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 13
; Schema: 0
;
; ID %13 is assigned an unsupported external instruction set.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
%13 = OpExtInstImport "OpenCL.std"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,35 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; A non-32 float width is used in OpTypeFloat.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 16
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,37 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 13
; Schema: 0
;
; A GLSL instruction not in the set defined in `constants.dart` is used
; on line 30.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
%13 = OpExtInst %v4float %1 Round %11
OpStore %oColor %13
OpReturn
OpFunctionEnd

View File

@@ -1,37 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; A matrix type is defined with a component count not in the set of
; {2, 3, 4}, on line 24.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%13 = OpTypeMatrix %v4float 5
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,36 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; A matrix type is defined with a non-square matrix size.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%13 = OpTypeMatrix %v4float 3
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,36 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; OpMemoryModel is called with a non 'GLSL450' value, here
; 'Simple' is used instead.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical Simple
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,37 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; OpVariable uses a Storage Class not in the set
; {UniformConstant, Input, Output, Function}, on line 25.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%13 = OpVariable %_ptr_Output_v4float Image
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,37 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 12
; Schema: 0
;
; A vector type is defined with a component count not in the set of
; {2, 3, 4}, on line 24.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%v8float = OpTypeVector %float 8
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -1,37 +0,0 @@
; Copyright 2013 The Flutter Authors. All rights reserved.
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 14
; Schema: 0
;
; OpTypeVector is called with a base type that is not Float,
; here an undefined ID %13 is used, on line 24.
;
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %oColor
OpExecutionMode %main OriginLowerLeft
OpSource ESSL 320
OpName %main "main"
OpName %oColor "oColor"
OpDecorate %oColor RelaxedPrecision
OpDecorate %oColor Location 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%14 = OpTypeVector %13 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%oColor = OpVariable %_ptr_Output_v4float Output
%float_0 = OpConstant %float 0
%11 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main = OpFunction %void None %3
%5 = OpLabel
OpStore %oColor %11
OpReturn
OpFunctionEnd

View File

@@ -183,6 +183,7 @@ source_set("ui") {
if (enable_unittests) {
test_fixtures("ui_unittests_fixtures") {
deps = [ "fixtures/shaders" ]
dart_main = "fixtures/ui_test.dart"
fixtures = [
"fixtures/DashInNooglerHat.jpg",

View File

@@ -164,7 +164,6 @@ typedef CanvasPath Path;
V(ColorFilter, initMode, 3) \
V(ColorFilter, initSrgbToLinearGamma, 1) \
V(EngineLayer, dispose, 1) \
V(FragmentProgram, init, 3) \
V(FragmentProgram, initFromAsset, 2) \
V(FragmentProgram, shader, 4) \
V(Gradient, initLinear, 6) \

View File

@@ -0,0 +1,36 @@
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//flutter/impeller/tools/impeller.gni")
import("//flutter/testing/testing.gni")
if (enable_unittests) {
group("shaders") {
testonly = true
deps = [
":fixtures",
# TODO(zra): Remove this when it is no longer referenced in the
# recipe.
"//flutter/lib/spirv/test/exception_shaders:spirv_compile_exception_shaders",
"//flutter/lib/ui/fixtures/shaders/general_shaders",
"//flutter/lib/ui/fixtures/shaders/supported_glsl_op_shaders",
"//flutter/lib/ui/fixtures/shaders/supported_op_shaders",
]
}
impellerc("ink_sparkle") {
shaders = [ "//flutter/impeller/fixtures/ink_sparkle.frag" ]
shader_target_flag = "--sksl"
intermediates_subdir = "iplr"
sl_file_extension = "iplr"
iplr = true
}
test_fixtures("fixtures") {
deps = [ ":ink_sparkle" ]
fixtures = get_target_outputs(":ink_sparkle")
dest = "$root_gen_dir/flutter/lib/ui"
}
}

View File

@@ -19,27 +19,10 @@ if (enable_unittests) {
group("general_shaders") {
testonly = true
deps = [
":fixtures",
":sksl_compile_general_shaders",
":spirv_compile_general_shaders",
]
deps = [ ":fixtures" ]
}
impellerc("spirv_compile_general_shaders") {
shaders = test_shaders
shader_target_flag = "--flutter-spirv"
intermediates_subdir = "spirv"
}
impellerc("sksl_compile_general_shaders") {
shaders = test_shaders
shader_target_flag = "--sksl"
intermediates_subdir = "sksl"
sl_file_extension = "sksl"
}
impellerc("sksl_compile_general_shaders_iplr") {
impellerc("compile_general_shaders") {
shaders = test_shaders
shader_target_flag = "--sksl"
intermediates_subdir = "iplr"
@@ -48,8 +31,8 @@ if (enable_unittests) {
}
test_fixtures("fixtures") {
deps = [ ":sksl_compile_general_shaders_iplr" ]
fixtures = get_target_outputs(":sksl_compile_general_shaders_iplr")
deps = [ ":compile_general_shaders" ]
fixtures = get_target_outputs(":compile_general_shaders")
dest = "$root_gen_dir/flutter/lib/ui"
}
}

View File

@@ -45,27 +45,10 @@ if (enable_unittests) {
group("supported_glsl_op_shaders") {
testonly = true
deps = [
":fixtures",
":sksl_compile_supported_glsl_shaders",
":spirv_compile_supported_glsl_shaders",
]
deps = [ ":fixtures" ]
}
impellerc("spirv_compile_supported_glsl_shaders") {
shaders = test_shaders
shader_target_flag = "--flutter-spirv"
intermediates_subdir = "spirv"
}
impellerc("sksl_compile_supported_glsl_shaders") {
shaders = test_shaders
shader_target_flag = "--sksl"
intermediates_subdir = "sksl"
sl_file_extension = "sksl"
}
impellerc("iplr_compile_supported_glsl_shaders") {
impellerc("compile_supported_glsl_shaders") {
shaders = test_shaders
shader_target_flag = "--sksl"
intermediates_subdir = "iplr"
@@ -74,8 +57,8 @@ if (enable_unittests) {
}
test_fixtures("fixtures") {
deps = [ ":iplr_compile_supported_glsl_shaders" ]
fixtures = get_target_outputs(":iplr_compile_supported_glsl_shaders")
deps = [ ":compile_supported_glsl_shaders" ]
fixtures = get_target_outputs(":compile_supported_glsl_shaders")
dest = "$root_gen_dir/flutter/lib/ui"
}
}

Some files were not shown because too many files have changed in this diff Show More