2020-04-08 20:40:25 +00:00
|
|
|
# Copyright 2020 The Tint Authors.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
import("//build_overrides/tint.gni")
|
|
|
|
|
|
|
|
# This file contains Tint-related build flags.
|
|
|
|
|
|
|
|
declare_args() {
|
2020-04-27 15:31:27 +00:00
|
|
|
# Path to tint checkout
|
|
|
|
if (!defined(tint_root_dir)) {
|
|
|
|
tint_root_dir = "//"
|
|
|
|
}
|
|
|
|
|
2020-04-15 20:35:38 +00:00
|
|
|
# Path to spirv-tools checkout
|
|
|
|
if (!defined(tint_spirv_tools_dir)) {
|
2022-03-28 18:01:02 +00:00
|
|
|
tint_spirv_tools_dir = "//third_party/vulkan-deps/spirv-tools/src"
|
2020-04-15 20:35:38 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
# Path to googletest checkout
|
|
|
|
if (!defined(tint_googletest_dir)) {
|
|
|
|
tint_googletest_dir = "//third_party/googletest"
|
|
|
|
}
|
|
|
|
|
2020-04-15 20:35:38 +00:00
|
|
|
# Path to spirv-headers checkout
|
|
|
|
if (!defined(tint_spirv_headers_dir)) {
|
2022-03-28 18:01:02 +00:00
|
|
|
tint_spirv_headers_dir = "//third_party/vulkan-deps/spirv-headers/src"
|
2020-04-15 20:35:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Build the SPIR-V input reader
|
|
|
|
if (!defined(tint_build_spv_reader)) {
|
2020-07-30 18:44:04 +00:00
|
|
|
tint_build_spv_reader = true
|
2020-04-15 20:35:38 +00:00
|
|
|
}
|
|
|
|
|
2020-04-15 20:37:02 +00:00
|
|
|
# Build the SPIR-V output writer
|
|
|
|
if (!defined(tint_build_spv_writer)) {
|
2020-07-30 18:44:04 +00:00
|
|
|
tint_build_spv_writer = true
|
2020-04-15 20:37:02 +00:00
|
|
|
}
|
|
|
|
|
2020-04-15 20:47:55 +00:00
|
|
|
# Build the WGSL input reader
|
|
|
|
if (!defined(tint_build_wgsl_reader)) {
|
2020-07-30 18:44:04 +00:00
|
|
|
tint_build_wgsl_reader = true
|
2020-04-15 20:47:55 +00:00
|
|
|
}
|
|
|
|
|
2020-04-15 20:54:10 +00:00
|
|
|
# Build the WGSL output writer
|
|
|
|
if (!defined(tint_build_wgsl_writer)) {
|
2020-07-30 18:44:04 +00:00
|
|
|
tint_build_wgsl_writer = true
|
2020-04-15 20:54:10 +00:00
|
|
|
}
|
2020-06-23 17:48:40 +00:00
|
|
|
|
|
|
|
# Build the MSL output writer
|
|
|
|
if (!defined(tint_build_msl_writer)) {
|
2020-07-30 18:44:04 +00:00
|
|
|
tint_build_msl_writer = true
|
2020-06-23 17:48:40 +00:00
|
|
|
}
|
2020-07-22 20:41:12 +00:00
|
|
|
|
|
|
|
# Build the HLSL output writer
|
|
|
|
if (!defined(tint_build_hlsl_writer)) {
|
2020-07-30 18:44:04 +00:00
|
|
|
tint_build_hlsl_writer = true
|
2020-07-22 20:41:12 +00:00
|
|
|
}
|
Implement GLSL writer backend.
This is a modified version of the HLSL writer.
Basic types, arrays, entry points, reserved keywords, uniforms,
builtin uniforms, structs, some builtin functions, zero initialization
are implemented. Textures, SSBOs and storage textures in particular are
unimplemented. All the unit tests "pass", but the output is not correct
in many cases.
triangle.wgsl outputs correct vertex and fragment shaders that pass
GLSL validation via glslang. compute_boids.wgsl outputs a valid but not
correct compute shader.
Change-Id: I96c7aaf60cf2d4237e45d732e5f51b345aea0552
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57780
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-10-06 18:55:10 +00:00
|
|
|
|
|
|
|
# Build the GLSL output writer
|
|
|
|
if (!defined(tint_build_glsl_writer)) {
|
|
|
|
tint_build_glsl_writer = true
|
|
|
|
}
|
2022-06-22 12:40:43 +00:00
|
|
|
|
|
|
|
# Build unittests
|
|
|
|
if (!defined(tint_build_unittests)) {
|
|
|
|
tint_build_unittests = true
|
|
|
|
}
|
2022-11-01 17:03:48 +00:00
|
|
|
|
|
|
|
# Build with generated files
|
|
|
|
if (!defined(tint_build_use_generator)) {
|
|
|
|
tint_build_use_generator = false
|
|
|
|
}
|
2020-04-15 20:35:38 +00:00
|
|
|
}
|