Start wiring up impellerc
This commit is contained in:
15
engine/src/flutter/impeller/compiler/BUILD.gn
Normal file
15
engine/src/flutter/impeller/compiler/BUILD.gn
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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.
|
||||
|
||||
executable("compiler") {
|
||||
output_name = "impellerc"
|
||||
|
||||
sources = [ "impellerc_main.cc" ]
|
||||
|
||||
deps = [
|
||||
"//flutter/fml",
|
||||
"//flutter/runtime:libdart",
|
||||
"//third_party/shaderc_flutter",
|
||||
]
|
||||
}
|
||||
23
engine/src/flutter/impeller/compiler/impellerc_main.cc
Normal file
23
engine/src/flutter/impeller/compiler/impellerc_main.cc
Normal file
@@ -0,0 +1,23 @@
|
||||
// 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.
|
||||
|
||||
#include "flutter/fml/command_line.h"
|
||||
#include "flutter/fml/macros.h"
|
||||
#include "third_party/shaderc/libshaderc/include/shaderc/shaderc.hpp"
|
||||
|
||||
namespace impeller {
|
||||
namespace compiler {
|
||||
|
||||
bool Main(const fml::CommandLine& command_line) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace compiler
|
||||
} // namespace impeller
|
||||
|
||||
int main(int argc, char const* argv[]) {
|
||||
return impeller::compiler::Main(fml::CommandLineFromArgcArgv(argc, argv))
|
||||
? EXIT_SUCCESS
|
||||
: EXIT_FAILURE;
|
||||
}
|
||||
7
engine/src/flutter/impeller/compiler/tools/compiler.gni
Normal file
7
engine/src/flutter/impeller/compiler/tools/compiler.gni
Normal file
@@ -0,0 +1,7 @@
|
||||
# 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.
|
||||
|
||||
template("impeller_shaders") {
|
||||
assert(defined(invoker.shaders), "Impeller shaders must be specified.")
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(binding = 1) uniform sampler2D textureSampler;
|
||||
|
||||
layout(location = 0) in vec2 inTextureCoord;
|
||||
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
outColor = texture(textureSampler, inTextureCoord);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject {
|
||||
mat4 model;
|
||||
mat4 view;
|
||||
mat4 projection;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) in vec3 inPosition;
|
||||
layout(location = 1) in vec2 inTextureCoord;
|
||||
|
||||
layout(location = 0) out vec2 outTextureCoord;
|
||||
|
||||
void main() {
|
||||
gl_Position = ubo.projection * ubo.view * ubo.model * vec4(inPosition, 1.0);
|
||||
outTextureCoord = inTextureCoord;
|
||||
}
|
||||
Reference in New Issue
Block a user