| # Copyright 2021 The Cobalt Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| _output_dir = "$root_gen_dir/egl" |
| _shader_impl_header = "$_output_dir/generated_shader_impl.h" |
| _shader_impl_source = "$_output_dir/generated_shader_impl.cc" |
| |
| action("create_shader_classes") { |
| shader_sources = [ |
| "fragment_color.glsl", |
| "fragment_color_blur.glsl", |
| "fragment_color_blur_rrects.glsl", |
| "fragment_color_include.glsl", |
| "fragment_color_texcoord.glsl", |
| "fragment_color_texcoord_yuv3.glsl", |
| "fragment_opacity_texcoord1d.glsl", |
| "fragment_rcorner2_color.glsl", |
| "fragment_rcorner_color.glsl", |
| "fragment_rcorner_texcoord_color.glsl", |
| "fragment_rcorner_texcoord_color_yuv3.glsl", |
| "fragment_texcoord.glsl", |
| "fragment_texcoord_yuv3.glsl", |
| "function_gaussian_integral.inc", |
| "function_is_outside_rcorner.inc", |
| "image_sampler_rgba.inc", |
| "image_sampler_rgba_with_clamp.inc", |
| "image_sampler_yuv3.inc", |
| "image_sampler_yuv3_with_clamp.inc", |
| "vertex_color.glsl", |
| "vertex_color_offset.glsl", |
| "vertex_color_texcoord.glsl", |
| "vertex_offset.glsl", |
| "vertex_offset_rcorner.glsl", |
| "vertex_rcorner.glsl", |
| "vertex_rcorner2.glsl", |
| "vertex_rcorner_texcoord.glsl", |
| "vertex_texcoord.glsl", |
| ] |
| |
| input_shader_files_file = "${target_gen_dir}/generate_shader_impl_inputs.tmp" |
| write_file(input_shader_files_file, |
| rebase_path(shader_sources, root_build_dir)) |
| |
| script = "generate_shader_impl.py" |
| |
| inputs = [ input_shader_files_file ] |
| |
| outputs = [ |
| _shader_impl_header, |
| _shader_impl_source, |
| ] |
| |
| args = rebase_path(outputs, root_build_dir) + |
| [ rebase_path(input_shader_files_file, root_build_dir) ] |
| } |
| |
| config("shaders_config") { |
| include_dirs = [ "$target_gen_dir" ] |
| } |
| |
| static_library("shaders") { |
| sources = [ |
| _shader_impl_header, |
| _shader_impl_source, |
| ] |
| |
| public_configs = [ ":shaders_config" ] |
| |
| deps = [ |
| ":create_shader_classes", |
| "//starboard:starboard_headers_only", |
| ] |
| } |