2020-03-02 20:47:43 +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.
|
|
|
|
|
2020-03-18 14:08:48 +00:00
|
|
|
function(tint_spvtools_compile_options TARGET)
|
|
|
|
# We'll use the optimizer for its nice SPIR-V in-memory representation
|
|
|
|
target_link_libraries(${TARGET} SPIRV-Tools-opt SPIRV-Tools)
|
|
|
|
|
|
|
|
# We'll be cheating: using internal interfaces to the SPIRV-Tools
|
|
|
|
# optimizer.
|
|
|
|
target_include_directories(${TARGET} PRIVATE
|
|
|
|
${spirv-tools_SOURCE_DIR}
|
|
|
|
${spirv-tools_BINARY_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
if (${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
|
|
|
|
# The SPIRV-Tools code is conditioned against C++ and an older version of Clang.
|
|
|
|
# Suppress warnings triggered in our current compilation environment.
|
|
|
|
# TODO(dneto): Fix the issues upstream.
|
|
|
|
target_compile_options(${TARGET} PRIVATE
|
|
|
|
-Wno-newline-eof
|
|
|
|
-Wno-sign-conversion
|
|
|
|
-Wno-old-style-cast
|
|
|
|
-Wno-weak-vtables
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
2022-01-19 21:40:20 +00:00
|
|
|
## Tint diagnostic utilities. Used by libtint and tint_utils_io.
|
|
|
|
add_library(tint_diagnostic_utils
|
|
|
|
debug.cc
|
|
|
|
debug.h
|
2022-01-27 17:36:27 +00:00
|
|
|
source.h
|
|
|
|
source.cc
|
2022-01-19 21:40:20 +00:00
|
|
|
diagnostic/diagnostic.cc
|
|
|
|
diagnostic/diagnostic.h
|
|
|
|
diagnostic/formatter.cc
|
|
|
|
diagnostic/formatter.h
|
|
|
|
diagnostic/printer.cc
|
|
|
|
diagnostic/printer.h
|
2022-02-04 22:25:45 +00:00
|
|
|
utils/debugger.cc
|
|
|
|
utils/debugger.h
|
2022-01-19 21:40:20 +00:00
|
|
|
)
|
|
|
|
tint_default_compile_options(tint_diagnostic_utils)
|
|
|
|
|
2020-03-02 20:47:43 +00:00
|
|
|
set(TINT_LIB_SRCS
|
2020-06-11 19:35:20 +00:00
|
|
|
../include/tint/tint.h
|
2021-06-04 20:41:47 +00:00
|
|
|
ast/access.cc
|
|
|
|
ast/access.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/attribute.cc
|
|
|
|
ast/attribute.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/alias.cc
|
|
|
|
ast/alias.h
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/index_accessor_expression.cc
|
|
|
|
ast/index_accessor_expression.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/array.cc
|
|
|
|
ast/array.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/assignment_statement.cc
|
|
|
|
ast/assignment_statement.h
|
2021-06-17 15:48:39 +00:00
|
|
|
ast/atomic.cc
|
|
|
|
ast/atomic.h
|
2020-04-07 19:27:41 +00:00
|
|
|
ast/binary_expression.cc
|
|
|
|
ast/binary_expression.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/binding_attribute.cc
|
|
|
|
ast/binding_attribute.h
|
2020-09-22 22:07:13 +00:00
|
|
|
ast/bitcast_expression.cc
|
|
|
|
ast/bitcast_expression.h
|
2020-07-27 15:25:00 +00:00
|
|
|
ast/block_statement.cc
|
|
|
|
ast/block_statement.h
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/bool_literal_expression.cc
|
|
|
|
ast/bool_literal_expression.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/bool.cc
|
|
|
|
ast/bool.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/break_statement.cc
|
|
|
|
ast/break_statement.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/builtin_attribute.cc
|
|
|
|
ast/builtin_attribute.h
|
2021-01-21 15:42:10 +00:00
|
|
|
ast/builtin.cc
|
|
|
|
ast/builtin.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/call_expression.cc
|
|
|
|
ast/call_expression.h
|
2020-07-21 13:42:05 +00:00
|
|
|
ast/call_statement.cc
|
|
|
|
ast/call_statement.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/case_statement.cc
|
|
|
|
ast/case_statement.h
|
|
|
|
ast/continue_statement.cc
|
|
|
|
ast/continue_statement.h
|
2021-07-26 22:19:48 +00:00
|
|
|
ast/depth_multisampled_texture.cc
|
|
|
|
ast/depth_multisampled_texture.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/disable_validation_attribute.cc
|
|
|
|
ast/disable_validation_attribute.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/depth_texture.cc
|
|
|
|
ast/depth_texture.h
|
2020-07-25 03:34:33 +00:00
|
|
|
ast/discard_statement.cc
|
|
|
|
ast/discard_statement.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/else_statement.cc
|
|
|
|
ast/else_statement.h
|
|
|
|
ast/expression.cc
|
|
|
|
ast/expression.h
|
2021-04-26 14:55:25 +00:00
|
|
|
ast/external_texture.cc
|
|
|
|
ast/external_texture.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/f32.cc
|
|
|
|
ast/f32.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/fallthrough_statement.cc
|
|
|
|
ast/fallthrough_statement.h
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/float_literal_expression.cc
|
|
|
|
ast/float_literal_expression.h
|
2021-07-02 19:27:42 +00:00
|
|
|
ast/for_loop_statement.cc
|
|
|
|
ast/for_loop_statement.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/function.cc
|
|
|
|
ast/function.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/group_attribute.cc
|
|
|
|
ast/group_attribute.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/i32.cc
|
|
|
|
ast/i32.h
|
2022-02-15 16:36:57 +00:00
|
|
|
ast/id_attribute.cc
|
|
|
|
ast/id_attribute.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/identifier_expression.cc
|
|
|
|
ast/identifier_expression.h
|
|
|
|
ast/if_statement.cc
|
|
|
|
ast/if_statement.h
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/int_literal_expression.cc
|
|
|
|
ast/int_literal_expression.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/internal_attribute.cc
|
|
|
|
ast/internal_attribute.h
|
|
|
|
ast/interpolate_attribute.cc
|
|
|
|
ast/interpolate_attribute.h
|
|
|
|
ast/invariant_attribute.cc
|
|
|
|
ast/invariant_attribute.h
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/literal_expression.cc
|
|
|
|
ast/literal_expression.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/location_attribute.cc
|
|
|
|
ast/location_attribute.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/loop_statement.cc
|
|
|
|
ast/loop_statement.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/matrix.cc
|
|
|
|
ast/matrix.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/member_accessor_expression.cc
|
|
|
|
ast/member_accessor_expression.h
|
|
|
|
ast/module.cc
|
|
|
|
ast/module.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/multisampled_texture.cc
|
|
|
|
ast/multisampled_texture.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/node.cc
|
|
|
|
ast/node.h
|
2021-10-21 18:33:14 +00:00
|
|
|
ast/phony_expression.cc
|
|
|
|
ast/phony_expression.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/pipeline_stage.cc
|
|
|
|
ast/pipeline_stage.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/pointer.cc
|
|
|
|
ast/pointer.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/return_statement.cc
|
|
|
|
ast/return_statement.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/sampled_texture.cc
|
|
|
|
ast/sampled_texture.h
|
|
|
|
ast/sampler.cc
|
|
|
|
ast/sampler.h
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/sint_literal_expression.cc
|
|
|
|
ast/sint_literal_expression.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/stage_attribute.cc
|
|
|
|
ast/stage_attribute.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/statement.cc
|
|
|
|
ast/statement.h
|
|
|
|
ast/storage_class.cc
|
|
|
|
ast/storage_class.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/storage_texture.cc
|
|
|
|
ast/storage_texture.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/stride_attribute.cc
|
|
|
|
ast/stride_attribute.h
|
|
|
|
ast/struct_block_attribute.cc
|
|
|
|
ast/struct_block_attribute.h
|
|
|
|
ast/struct_member_align_attribute.cc
|
|
|
|
ast/struct_member_align_attribute.h
|
|
|
|
ast/struct_member_offset_attribute.cc
|
|
|
|
ast/struct_member_offset_attribute.h
|
|
|
|
ast/struct_member_size_attribute.cc
|
|
|
|
ast/struct_member_size_attribute.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/struct_member.cc
|
|
|
|
ast/struct_member.h
|
|
|
|
ast/struct.cc
|
|
|
|
ast/struct.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/switch_statement.cc
|
|
|
|
ast/switch_statement.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/texture.cc
|
|
|
|
ast/texture.h
|
2021-10-21 20:38:54 +00:00
|
|
|
ast/traverse_expressions.h
|
2021-04-23 15:41:34 +00:00
|
|
|
ast/type_name.cc
|
|
|
|
ast/type_name.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/ast_type.cc # TODO(bclayton) - rename to type.cc
|
|
|
|
ast/type.h
|
2021-06-09 14:32:14 +00:00
|
|
|
ast/type_decl.cc
|
|
|
|
ast/type_decl.h
|
2021-04-26 14:19:55 +00:00
|
|
|
ast/type_name.cc
|
|
|
|
ast/type_name.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/u32.cc
|
|
|
|
ast/u32.h
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/uint_literal_expression.cc
|
|
|
|
ast/uint_literal_expression.h
|
2020-03-02 20:47:43 +00:00
|
|
|
ast/unary_op_expression.cc
|
|
|
|
ast/unary_op_expression.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/unary_op.cc
|
|
|
|
ast/unary_op.h
|
2020-03-30 22:46:48 +00:00
|
|
|
ast/variable_decl_statement.cc
|
|
|
|
ast/variable_decl_statement.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/variable.cc
|
|
|
|
ast/variable.h
|
|
|
|
ast/vector.cc
|
|
|
|
ast/vector.h
|
|
|
|
ast/void.cc
|
|
|
|
ast/void.h
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/workgroup_attribute.cc
|
|
|
|
ast/workgroup_attribute.h
|
2021-01-21 15:30:10 +00:00
|
|
|
block_allocator.h
|
2022-02-02 23:07:11 +00:00
|
|
|
builtin_table.cc
|
|
|
|
builtin_table.h
|
|
|
|
builtin_table.inl
|
2020-11-30 22:50:25 +00:00
|
|
|
castable.cc
|
|
|
|
castable.h
|
2021-01-21 16:20:40 +00:00
|
|
|
clone_context.cc
|
|
|
|
clone_context.h
|
2020-12-11 18:29:03 +00:00
|
|
|
demangler.cc
|
2021-02-17 20:13:34 +00:00
|
|
|
demangler.h
|
2020-10-16 02:26:54 +00:00
|
|
|
inspector/entry_point.cc
|
|
|
|
inspector/entry_point.h
|
|
|
|
inspector/inspector.cc
|
|
|
|
inspector/inspector.h
|
2021-06-17 23:29:03 +00:00
|
|
|
inspector/resource_binding.cc
|
|
|
|
inspector/resource_binding.h
|
2020-10-16 02:26:54 +00:00
|
|
|
inspector/scalar.cc
|
|
|
|
inspector/scalar.h
|
2021-01-26 16:57:10 +00:00
|
|
|
program_builder.cc
|
|
|
|
program_builder.h
|
2021-04-13 23:27:27 +00:00
|
|
|
program_id.cc
|
|
|
|
program_id.h
|
2021-01-26 16:57:10 +00:00
|
|
|
program.cc
|
2021-01-25 18:14:08 +00:00
|
|
|
program.h
|
2020-03-02 20:47:43 +00:00
|
|
|
reader/reader.cc
|
|
|
|
reader/reader.h
|
2021-11-22 11:44:57 +00:00
|
|
|
resolver/dependency_graph.cc
|
|
|
|
resolver/dependency_graph.h
|
2021-03-09 10:54:37 +00:00
|
|
|
resolver/resolver.cc
|
2021-07-13 12:18:13 +00:00
|
|
|
resolver/resolver_constants.cc
|
2021-11-18 17:11:56 +00:00
|
|
|
resolver/resolver_validation.cc
|
2021-03-09 10:54:37 +00:00
|
|
|
resolver/resolver.h
|
2020-04-03 02:35:23 +00:00
|
|
|
scope_stack.h
|
2021-04-20 15:04:21 +00:00
|
|
|
sem/array.cc
|
2021-04-16 19:07:51 +00:00
|
|
|
sem/array.h
|
2021-06-17 15:48:39 +00:00
|
|
|
sem/atomic_type.cc
|
|
|
|
sem/atomic_type.h
|
2021-11-30 13:25:12 +00:00
|
|
|
sem/behavior.cc
|
|
|
|
sem/behavior.h
|
2021-05-10 19:16:46 +00:00
|
|
|
sem/binding_point.h
|
2021-05-15 14:48:46 +00:00
|
|
|
sem/block_statement.cc
|
|
|
|
sem/block_statement.h
|
2022-02-02 23:07:11 +00:00
|
|
|
sem/builtin_type.cc
|
|
|
|
sem/builtin_type.h
|
|
|
|
sem/builtin.cc
|
|
|
|
sem/builtin.h
|
2021-04-20 15:04:21 +00:00
|
|
|
sem/call_target.cc
|
2021-04-16 19:07:51 +00:00
|
|
|
sem/call_target.h
|
2021-04-19 15:20:03 +00:00
|
|
|
sem/call.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
sem/call.h
|
2021-07-13 12:18:13 +00:00
|
|
|
sem/constant.cc
|
|
|
|
sem/constant.h
|
2021-07-26 22:19:48 +00:00
|
|
|
sem/depth_multisampled_texture_type.cc
|
|
|
|
sem/depth_multisampled_texture_type.h
|
2021-04-19 15:20:03 +00:00
|
|
|
sem/expression.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
sem/expression.h
|
2021-04-19 15:20:03 +00:00
|
|
|
sem/function.cc
|
|
|
|
sem/info.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
sem/info.h
|
|
|
|
sem/member_accessor_expression.cc
|
2021-06-01 10:00:10 +00:00
|
|
|
sem/parameter_usage.cc
|
|
|
|
sem/parameter_usage.h
|
2021-06-03 16:07:34 +00:00
|
|
|
sem/pipeline_stage_set.h
|
2021-04-19 15:20:03 +00:00
|
|
|
sem/node.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
sem/node.h
|
2022-02-09 23:55:51 +00:00
|
|
|
sem/module.cc
|
|
|
|
sem/module.h
|
2022-01-14 20:08:42 +00:00
|
|
|
sem/sampler_texture_pair.h
|
2021-04-19 15:20:03 +00:00
|
|
|
sem/statement.cc
|
|
|
|
sem/struct.cc
|
2021-04-16 19:07:51 +00:00
|
|
|
sem/type_mappings.h
|
2021-04-20 15:04:21 +00:00
|
|
|
sem/variable.cc
|
2020-12-10 16:56:02 +00:00
|
|
|
symbol_table.cc
|
|
|
|
symbol_table.h
|
2021-04-20 15:04:21 +00:00
|
|
|
symbol.cc
|
|
|
|
symbol.h
|
2021-01-21 16:20:40 +00:00
|
|
|
traits.h
|
2021-09-07 18:59:21 +00:00
|
|
|
transform/add_empty_entry_point.cc
|
|
|
|
transform/add_empty_entry_point.h
|
2022-02-02 23:07:11 +00:00
|
|
|
transform/add_spirv_block_attribute.cc
|
|
|
|
transform/add_spirv_block_attribute.h
|
2021-06-19 00:33:35 +00:00
|
|
|
transform/array_length_from_uniform.cc
|
|
|
|
transform/array_length_from_uniform.h
|
2021-03-29 21:25:45 +00:00
|
|
|
transform/binding_remapper.cc
|
|
|
|
transform/binding_remapper.h
|
2021-04-09 10:28:48 +00:00
|
|
|
transform/calculate_array_length.cc
|
|
|
|
transform/calculate_array_length.h
|
2022-01-24 17:17:22 +00:00
|
|
|
transform/combine_samplers.cc
|
|
|
|
transform/combine_samplers.h
|
2021-03-31 17:44:27 +00:00
|
|
|
transform/canonicalize_entry_point_io.cc
|
|
|
|
transform/canonicalize_entry_point_io.h
|
2021-06-18 21:15:25 +00:00
|
|
|
transform/decompose_memory_access.cc
|
|
|
|
transform/decompose_memory_access.h
|
2022-02-04 15:39:34 +00:00
|
|
|
transform/decompose_strided_array.cc
|
|
|
|
transform/decompose_strided_array.h
|
2021-07-27 08:17:29 +00:00
|
|
|
transform/decompose_strided_matrix.cc
|
|
|
|
transform/decompose_strided_matrix.h
|
2021-05-05 16:38:12 +00:00
|
|
|
transform/external_texture_transform.cc
|
|
|
|
transform/external_texture_transform.h
|
2020-12-08 21:07:24 +00:00
|
|
|
transform/first_index_offset.cc
|
|
|
|
transform/first_index_offset.h
|
2021-06-18 14:59:51 +00:00
|
|
|
transform/fold_constants.cc
|
|
|
|
transform/fold_constants.h
|
2021-07-02 21:15:44 +00:00
|
|
|
transform/fold_trivial_single_use_lets.cc
|
|
|
|
transform/fold_trivial_single_use_lets.h
|
2021-12-13 15:55:11 +00:00
|
|
|
transform/localize_struct_array_assignment.cc
|
|
|
|
transform/localize_struct_array_assignment.h
|
2021-07-08 10:00:17 +00:00
|
|
|
transform/for_loop_to_loop.cc
|
|
|
|
transform/for_loop_to_loop.h
|
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
|
|
|
transform/glsl.cc
|
|
|
|
transform/glsl.h
|
2021-07-02 22:17:25 +00:00
|
|
|
transform/loop_to_for_loop.cc
|
|
|
|
transform/loop_to_for_loop.h
|
2020-09-29 23:54:03 +00:00
|
|
|
transform/manager.cc
|
|
|
|
transform/manager.h
|
2021-09-07 18:59:21 +00:00
|
|
|
transform/module_scope_var_to_entry_point_param.cc
|
|
|
|
transform/module_scope_var_to_entry_point_param.h
|
2021-11-17 12:10:16 +00:00
|
|
|
transform/multiplanar_external_texture.cc
|
|
|
|
transform/multiplanar_external_texture.h
|
2021-09-13 17:11:58 +00:00
|
|
|
transform/num_workgroups_from_uniform.cc
|
|
|
|
transform/num_workgroups_from_uniform.h
|
2021-06-16 09:50:11 +00:00
|
|
|
transform/pad_array_elements.cc
|
|
|
|
transform/pad_array_elements.h
|
2022-02-10 18:50:38 +00:00
|
|
|
transform/promote_initializers_to_const_var.cc
|
|
|
|
transform/promote_initializers_to_const_var.h
|
2021-10-21 23:04:44 +00:00
|
|
|
transform/remove_phonies.cc
|
|
|
|
transform/remove_phonies.h
|
2021-12-03 17:51:48 +00:00
|
|
|
transform/remove_unreachable_statements.cc
|
|
|
|
transform/remove_unreachable_statements.h
|
2021-03-04 11:12:45 +00:00
|
|
|
transform/renamer.cc
|
|
|
|
transform/renamer.h
|
2021-06-30 13:23:36 +00:00
|
|
|
transform/robustness.cc
|
|
|
|
transform/robustness.h
|
2021-11-23 20:45:51 +00:00
|
|
|
transform/simplify_pointers.cc
|
|
|
|
transform/simplify_pointers.h
|
2021-04-28 15:33:03 +00:00
|
|
|
transform/single_entry_point.cc
|
|
|
|
transform/single_entry_point.h
|
2020-12-04 09:06:09 +00:00
|
|
|
transform/transform.cc
|
|
|
|
transform/transform.h
|
2021-11-23 20:45:51 +00:00
|
|
|
transform/unshadow.cc
|
|
|
|
transform/unshadow.h
|
2021-10-25 19:20:31 +00:00
|
|
|
transform/vectorize_scalar_matrix_constructors.cc
|
|
|
|
transform/vectorize_scalar_matrix_constructors.h
|
2022-02-10 18:50:38 +00:00
|
|
|
transform/var_for_dynamic_index.cc
|
|
|
|
transform/var_for_dynamic_index.h
|
2020-12-04 09:06:09 +00:00
|
|
|
transform/vertex_pulling.cc
|
|
|
|
transform/vertex_pulling.h
|
2021-06-16 09:19:36 +00:00
|
|
|
transform/wrap_arrays_in_structs.cc
|
|
|
|
transform/wrap_arrays_in_structs.h
|
2021-06-18 22:44:31 +00:00
|
|
|
transform/zero_init_workgroup_memory.cc
|
|
|
|
transform/zero_init_workgroup_memory.h
|
2022-02-10 18:50:38 +00:00
|
|
|
transform/utils/hoist_to_decl_before.cc
|
|
|
|
transform/utils/hoist_to_decl_before.h
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/bool_type.cc
|
|
|
|
sem/bool_type.h
|
|
|
|
sem/depth_texture_type.cc
|
|
|
|
sem/depth_texture_type.h
|
|
|
|
sem/external_texture_type.cc
|
|
|
|
sem/external_texture_type.h
|
|
|
|
sem/f32_type.cc
|
|
|
|
sem/f32_type.h
|
2021-07-14 09:44:41 +00:00
|
|
|
sem/for_loop_statement.cc
|
|
|
|
sem/for_loop_statement.h
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/i32_type.cc
|
|
|
|
sem/i32_type.h
|
2021-07-14 09:44:41 +00:00
|
|
|
sem/if_statement.cc
|
|
|
|
sem/if_statement.h
|
|
|
|
sem/loop_statement.cc
|
|
|
|
sem/loop_statement.h
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/matrix_type.cc
|
|
|
|
sem/matrix_type.h
|
|
|
|
sem/multisampled_texture_type.cc
|
|
|
|
sem/multisampled_texture_type.h
|
|
|
|
sem/pointer_type.cc
|
|
|
|
sem/pointer_type.h
|
2021-05-10 19:45:46 +00:00
|
|
|
sem/reference_type.cc
|
|
|
|
sem/reference_type.h
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/sampled_texture_type.cc
|
|
|
|
sem/sampled_texture_type.h
|
|
|
|
sem/sampler_type.cc
|
|
|
|
sem/sampler_type.h
|
|
|
|
sem/storage_texture_type.cc
|
|
|
|
sem/storage_texture_type.h
|
2021-07-14 09:44:41 +00:00
|
|
|
sem/switch_statement.cc
|
|
|
|
sem/switch_statement.h
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/texture_type.cc
|
|
|
|
sem/texture_type.h
|
2021-11-12 13:53:49 +00:00
|
|
|
sem/type_constructor.cc
|
|
|
|
sem/type_constructor.h
|
2021-11-15 20:45:50 +00:00
|
|
|
sem/type_conversion.cc
|
|
|
|
sem/type_conversion.h
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/type.cc
|
|
|
|
sem/type.h
|
|
|
|
sem/type_manager.cc
|
|
|
|
sem/type_manager.h
|
|
|
|
sem/u32_type.cc
|
|
|
|
sem/u32_type.h
|
|
|
|
sem/vector_type.cc
|
|
|
|
sem/vector_type.h
|
|
|
|
sem/void_type.cc
|
|
|
|
sem/void_type.h
|
2022-01-24 21:07:20 +00:00
|
|
|
utils/crc32.h
|
2021-06-03 15:53:34 +00:00
|
|
|
utils/enum_set.h
|
2021-03-29 15:13:55 +00:00
|
|
|
utils/hash.h
|
2021-11-23 18:37:37 +00:00
|
|
|
utils/map.h
|
2021-03-29 15:13:55 +00:00
|
|
|
utils/math.h
|
2021-05-19 16:11:04 +00:00
|
|
|
utils/scoped_assignment.h
|
2021-10-14 20:24:50 +00:00
|
|
|
utils/string.h
|
2021-02-17 13:10:49 +00:00
|
|
|
utils/unique_vector.h
|
2020-12-09 15:57:00 +00:00
|
|
|
writer/append_vector.cc
|
|
|
|
writer/append_vector.h
|
2021-11-19 04:11:33 +00:00
|
|
|
writer/array_length_from_uniform_options.cc
|
|
|
|
writer/array_length_from_uniform_options.h
|
2020-11-20 10:04:44 +00:00
|
|
|
writer/float_to_string.cc
|
|
|
|
writer/float_to_string.h
|
2020-06-23 17:48:40 +00:00
|
|
|
writer/text_generator.cc
|
|
|
|
writer/text_generator.h
|
2021-04-20 15:04:21 +00:00
|
|
|
writer/text.cc
|
|
|
|
writer/text.h
|
2020-03-02 20:47:43 +00:00
|
|
|
writer/writer.cc
|
|
|
|
writer/writer.h
|
|
|
|
)
|
|
|
|
|
2020-11-02 19:26:28 +00:00
|
|
|
if(UNIX)
|
|
|
|
list(APPEND TINT_LIB_SRCS diagnostic/printer_linux.cc)
|
|
|
|
elseif(WIN32)
|
|
|
|
list(APPEND TINT_LIB_SRCS diagnostic/printer_windows.cc)
|
|
|
|
else()
|
|
|
|
list(APPEND TINT_LIB_SRCS diagnostic/printer_other.cc)
|
|
|
|
endif()
|
|
|
|
|
2020-03-18 14:08:48 +00:00
|
|
|
if(${TINT_BUILD_SPV_READER})
|
2020-03-02 20:47:43 +00:00
|
|
|
list(APPEND TINT_LIB_SRCS
|
2020-04-27 20:14:08 +00:00
|
|
|
reader/spirv/construct.h
|
|
|
|
reader/spirv/construct.cc
|
2020-09-22 14:22:12 +00:00
|
|
|
reader/spirv/entry_point_info.h
|
2021-04-29 00:09:04 +00:00
|
|
|
reader/spirv/entry_point_info.cc
|
2020-03-23 22:53:42 +00:00
|
|
|
reader/spirv/enum_converter.h
|
|
|
|
reader/spirv/enum_converter.cc
|
2020-03-17 20:07:41 +00:00
|
|
|
reader/spirv/fail_stream.h
|
2020-04-07 19:54:52 +00:00
|
|
|
reader/spirv/function.cc
|
|
|
|
reader/spirv/function.h
|
2020-03-20 19:24:23 +00:00
|
|
|
reader/spirv/namer.cc
|
|
|
|
reader/spirv/namer.h
|
2021-05-10 17:25:21 +00:00
|
|
|
reader/spirv/parser_type.cc
|
|
|
|
reader/spirv/parser_type.h
|
2020-03-17 20:07:41 +00:00
|
|
|
reader/spirv/parser.cc
|
|
|
|
reader/spirv/parser.h
|
|
|
|
reader/spirv/parser_impl.cc
|
|
|
|
reader/spirv/parser_impl.h
|
2020-11-17 18:32:18 +00:00
|
|
|
reader/spirv/usage.cc
|
|
|
|
reader/spirv/usage.h
|
2020-03-02 20:47:43 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-03-18 14:08:48 +00:00
|
|
|
if(${TINT_BUILD_WGSL_READER})
|
|
|
|
list(APPEND TINT_LIB_SRCS
|
|
|
|
reader/wgsl/lexer.cc
|
|
|
|
reader/wgsl/lexer.h
|
|
|
|
reader/wgsl/parser.cc
|
|
|
|
reader/wgsl/parser.h
|
|
|
|
reader/wgsl/parser_impl.cc
|
|
|
|
reader/wgsl/parser_impl.h
|
2020-11-09 20:44:34 +00:00
|
|
|
reader/wgsl/parser_impl_detail.h
|
2020-03-18 14:08:48 +00:00
|
|
|
reader/wgsl/token.cc
|
|
|
|
reader/wgsl/token.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${TINT_BUILD_SPV_WRITER})
|
|
|
|
list(APPEND TINT_LIB_SRCS
|
|
|
|
writer/spirv/binary_writer.cc
|
|
|
|
writer/spirv/binary_writer.h
|
|
|
|
writer/spirv/builder.cc
|
|
|
|
writer/spirv/builder.h
|
2020-04-01 23:40:53 +00:00
|
|
|
writer/spirv/function.cc
|
|
|
|
writer/spirv/function.h
|
2020-03-18 14:08:48 +00:00
|
|
|
writer/spirv/generator.cc
|
|
|
|
writer/spirv/generator.h
|
|
|
|
writer/spirv/instruction.cc
|
|
|
|
writer/spirv/instruction.h
|
|
|
|
writer/spirv/operand.cc
|
|
|
|
writer/spirv/operand.h
|
2021-03-22 15:32:35 +00:00
|
|
|
writer/spirv/scalar_constant.h
|
2020-03-18 14:08:48 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${TINT_BUILD_WGSL_WRITER})
|
|
|
|
list(APPEND TINT_LIB_SRCS
|
|
|
|
writer/wgsl/generator.cc
|
|
|
|
writer/wgsl/generator.h
|
|
|
|
writer/wgsl/generator_impl.cc
|
|
|
|
writer/wgsl/generator_impl.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-06-23 17:48:40 +00:00
|
|
|
if(${TINT_BUILD_MSL_WRITER})
|
|
|
|
list(APPEND TINT_LIB_SRCS
|
|
|
|
writer/msl/generator.cc
|
|
|
|
writer/msl/generator.h
|
|
|
|
writer/msl/generator_impl.cc
|
|
|
|
writer/msl/generator_impl.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
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
|
|
|
if(${TINT_BUILD_GLSL_WRITER})
|
|
|
|
list(APPEND TINT_LIB_SRCS
|
|
|
|
writer/glsl/generator.cc
|
|
|
|
writer/glsl/generator.h
|
|
|
|
writer/glsl/generator_impl.cc
|
|
|
|
writer/glsl/generator_impl.h
|
2022-02-09 17:44:17 +00:00
|
|
|
writer/glsl/version.h
|
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
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-07-20 22:13:37 +00:00
|
|
|
if(${TINT_BUILD_HLSL_WRITER})
|
|
|
|
list(APPEND TINT_LIB_SRCS
|
|
|
|
writer/hlsl/generator.cc
|
|
|
|
writer/hlsl/generator.h
|
|
|
|
writer/hlsl/generator_impl.cc
|
|
|
|
writer/hlsl/generator_impl.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-02-07 10:07:25 +00:00
|
|
|
if(MSVC)
|
|
|
|
list(APPEND TINT_LIB_SRCS
|
|
|
|
tint.natvis
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-06-02 21:02:34 +00:00
|
|
|
## Tint IO utilities. Used by tint_val.
|
|
|
|
add_library(tint_utils_io
|
|
|
|
utils/io/command_${TINT_OS_CC_SUFFIX}.cc
|
|
|
|
utils/io/command.h
|
|
|
|
utils/io/tmpfile_${TINT_OS_CC_SUFFIX}.cc
|
|
|
|
utils/io/tmpfile.h
|
|
|
|
)
|
|
|
|
tint_default_compile_options(tint_utils_io)
|
2022-01-19 21:40:20 +00:00
|
|
|
target_link_libraries(tint_utils_io tint_diagnostic_utils)
|
2021-06-02 21:02:34 +00:00
|
|
|
|
|
|
|
## Tint validation utilities. Used by tests and the tint executable.
|
|
|
|
add_library(tint_val
|
2021-06-08 19:38:27 +00:00
|
|
|
val/hlsl.cc
|
|
|
|
val/msl.cc
|
2021-06-02 21:02:34 +00:00
|
|
|
val/val.h
|
|
|
|
)
|
2021-06-08 19:38:27 +00:00
|
|
|
|
|
|
|
# If we're building on mac / ios and we have CoreGraphics, then we can use the
|
|
|
|
# metal API to validate our shaders. This is roughly 4x faster than invoking
|
|
|
|
# the metal shader compiler executable.
|
|
|
|
if(APPLE)
|
|
|
|
find_library(LIB_CORE_GRAPHICS CoreGraphics)
|
|
|
|
if(LIB_CORE_GRAPHICS)
|
|
|
|
target_sources(tint_val PRIVATE "val/msl_metal.mm")
|
|
|
|
target_compile_definitions(tint_val PUBLIC "-DTINT_ENABLE_MSL_VALIDATION_USING_METAL_API=1")
|
|
|
|
target_compile_options(tint_val PRIVATE "-fmodules" "-fcxx-modules")
|
|
|
|
target_link_options(tint_val PUBLIC "-framework" "CoreGraphics")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-06-02 21:02:34 +00:00
|
|
|
tint_default_compile_options(tint_val)
|
|
|
|
target_link_libraries(tint_val tint_utils_io)
|
|
|
|
|
2020-03-02 20:47:43 +00:00
|
|
|
## Tint library
|
|
|
|
add_library(libtint ${TINT_LIB_SRCS})
|
|
|
|
tint_default_compile_options(libtint)
|
2022-01-19 21:40:20 +00:00
|
|
|
target_link_libraries(libtint tint_diagnostic_utils)
|
2020-10-06 15:11:17 +00:00
|
|
|
if (${COMPILER_IS_LIKE_GNU})
|
|
|
|
target_compile_options(libtint PRIVATE -fvisibility=hidden)
|
|
|
|
endif()
|
2021-12-07 14:43:17 +00:00
|
|
|
if (${TINT_SYMBOL_STORE_DEBUG_NAME})
|
|
|
|
target_compile_definitions(libtint PUBLIC "TINT_SYMBOL_STORE_DEBUG_NAME=1")
|
|
|
|
endif()
|
2020-12-09 14:47:30 +00:00
|
|
|
set_target_properties(libtint PROPERTIES OUTPUT_NAME "tint")
|
|
|
|
|
2020-11-24 15:28:06 +00:00
|
|
|
if (${TINT_BUILD_FUZZERS})
|
|
|
|
# Tint library with fuzzer instrumentation
|
|
|
|
add_library(libtint-fuzz ${TINT_LIB_SRCS})
|
|
|
|
tint_default_compile_options(libtint-fuzz)
|
2022-01-19 21:40:20 +00:00
|
|
|
target_link_libraries(libtint-fuzz tint_diagnostic_utils)
|
2020-11-24 15:28:06 +00:00
|
|
|
if (${COMPILER_IS_LIKE_GNU})
|
|
|
|
target_compile_options(libtint-fuzz PRIVATE -fvisibility=hidden)
|
|
|
|
endif()
|
2021-09-02 23:49:25 +00:00
|
|
|
|
|
|
|
if (NOT ${TINT_LIB_FUZZING_ENGINE_LINK_OPTIONS} STREQUAL "")
|
|
|
|
# This is set when the fuzzers are being built by OSS-Fuzz. In this case the
|
|
|
|
# variable provides the necessary linker flags, and OSS-Fuzz will take care
|
|
|
|
# of passing suitable compiler flags.
|
|
|
|
target_link_options(libtint-fuzz PUBLIC ${TINT_LIB_FUZZING_ENGINE_LINK_OPTIONS})
|
|
|
|
else()
|
|
|
|
# When the fuzzers are being built outside of OSS-Fuzz, specific libFuzzer
|
|
|
|
# arguments to enable fuzzing are used.
|
|
|
|
target_compile_options(libtint-fuzz PUBLIC -fsanitize=fuzzer -fsanitize-coverage=trace-cmp)
|
|
|
|
target_link_options(libtint-fuzz PUBLIC -fsanitize=fuzzer -fsanitize-coverage=trace-cmp)
|
|
|
|
endif()
|
2020-11-24 15:28:06 +00:00
|
|
|
endif()
|
|
|
|
|
2020-12-10 14:33:31 +00:00
|
|
|
if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER})
|
|
|
|
tint_spvtools_compile_options(libtint)
|
|
|
|
if (${TINT_BUILD_FUZZERS})
|
|
|
|
tint_spvtools_compile_options(libtint-fuzz)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-01-18 18:58:16 +00:00
|
|
|
################################################################################
|
|
|
|
# Tests
|
|
|
|
################################################################################
|
|
|
|
if(TINT_BUILD_TESTS)
|
2020-12-09 14:47:30 +00:00
|
|
|
set(TINT_TEST_SRCS
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/alias_test.cc
|
|
|
|
ast/array_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/assignment_statement_test.cc
|
2021-06-17 15:48:39 +00:00
|
|
|
ast/atomic_test.cc
|
2021-01-21 15:42:10 +00:00
|
|
|
ast/binary_expression_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/binding_attribute_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/bitcast_expression_test.cc
|
|
|
|
ast/block_statement_test.cc
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/bool_literal_expression_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/bool_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/break_statement_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/builtin_attribute_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/builtin_texture_helper_test.cc
|
|
|
|
ast/builtin_texture_helper_test.h
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/call_expression_test.cc
|
|
|
|
ast/call_statement_test.cc
|
|
|
|
ast/case_statement_test.cc
|
|
|
|
ast/continue_statement_test.cc
|
2021-07-26 22:19:48 +00:00
|
|
|
ast/depth_multisampled_texture_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/depth_texture_test.cc
|
2021-01-21 15:42:10 +00:00
|
|
|
ast/discard_statement_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/else_statement_test.cc
|
2021-04-26 14:55:25 +00:00
|
|
|
ast/external_texture_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/f32_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/fallthrough_statement_test.cc
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/float_literal_expression_test.cc
|
2021-07-02 19:27:42 +00:00
|
|
|
ast/for_loop_statement_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/function_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/group_attribute_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/i32_test.cc
|
2022-02-15 16:36:57 +00:00
|
|
|
ast/id_attribute_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/identifier_expression_test.cc
|
|
|
|
ast/if_statement_test.cc
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/index_accessor_expression_test.cc
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/int_literal_expression_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/interpolate_attribute_test.cc
|
|
|
|
ast/invariant_attribute_test.cc
|
|
|
|
ast/location_attribute_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/loop_statement_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/matrix_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/member_accessor_expression_test.cc
|
|
|
|
ast/module_clone_test.cc
|
2021-01-26 16:57:10 +00:00
|
|
|
ast/module_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/multisampled_texture_test.cc
|
2021-10-21 18:33:14 +00:00
|
|
|
ast/phony_expression_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/pointer_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/return_statement_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/sampled_texture_test.cc
|
|
|
|
ast/sampler_test.cc
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/sint_literal_expression_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/stage_attribute_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/storage_texture_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/stride_attribute_test.cc
|
|
|
|
ast/struct_member_align_attribute_test.cc
|
|
|
|
ast/struct_member_offset_attribute_test.cc
|
|
|
|
ast/struct_member_size_attribute_test.cc
|
2021-01-21 15:42:10 +00:00
|
|
|
ast/struct_member_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/struct_test.cc
|
|
|
|
ast/switch_statement_test.cc
|
|
|
|
ast/test_helper.h
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/texture_test.cc
|
2021-10-21 20:38:54 +00:00
|
|
|
ast/traverse_expressions_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/u32_test.cc
|
2021-11-09 09:35:00 +00:00
|
|
|
ast/uint_literal_expression_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
ast/unary_op_expression_test.cc
|
|
|
|
ast/variable_decl_statement_test.cc
|
|
|
|
ast/variable_test.cc
|
2021-04-20 15:04:21 +00:00
|
|
|
ast/vector_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
ast/workgroup_attribute_test.cc
|
2021-01-21 15:30:10 +00:00
|
|
|
block_allocator_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
builtin_table_test.cc
|
2021-01-21 15:42:10 +00:00
|
|
|
castable_test.cc
|
2021-01-21 16:20:40 +00:00
|
|
|
clone_context_test.cc
|
2021-02-17 20:13:34 +00:00
|
|
|
debug_test.cc
|
2020-12-11 18:29:03 +00:00
|
|
|
demangler_test.cc
|
2022-01-27 17:36:27 +00:00
|
|
|
diagnostic/diagnostic_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
diagnostic/formatter_test.cc
|
|
|
|
diagnostic/printer_test.cc
|
2021-01-26 16:57:10 +00:00
|
|
|
program_test.cc
|
2021-09-07 14:48:24 +00:00
|
|
|
resolver/array_accessor_test.cc
|
2021-03-18 21:14:44 +00:00
|
|
|
resolver/assignment_validation_test.cc
|
2021-06-17 19:56:14 +00:00
|
|
|
resolver/atomics_test.cc
|
|
|
|
resolver/atomics_validation_test.cc
|
2021-12-03 21:29:13 +00:00
|
|
|
resolver/bitcast_validation_test.cc
|
2021-03-22 17:42:06 +00:00
|
|
|
resolver/builtins_validation_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
resolver/builtin_test.cc
|
|
|
|
resolver/builtin_validation_test.cc
|
2021-06-09 20:17:59 +00:00
|
|
|
resolver/call_test.cc
|
2021-06-11 13:22:27 +00:00
|
|
|
resolver/call_validation_test.cc
|
2021-07-14 09:44:41 +00:00
|
|
|
resolver/compound_statement_test.cc
|
2021-03-25 12:55:27 +00:00
|
|
|
resolver/control_block_validation_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
resolver/attribute_validation_test.cc
|
2021-11-22 11:44:57 +00:00
|
|
|
resolver/dependency_graph_test.cc
|
2021-04-06 15:51:47 +00:00
|
|
|
resolver/entry_point_validation_test.cc
|
2021-03-19 14:04:51 +00:00
|
|
|
resolver/function_validation_test.cc
|
2021-03-18 21:03:24 +00:00
|
|
|
resolver/host_shareable_validation_test.cc
|
2021-06-04 15:28:47 +00:00
|
|
|
resolver/inferred_type_test.cc
|
2021-03-18 21:03:24 +00:00
|
|
|
resolver/is_host_shareable_test.cc
|
2021-03-15 10:43:11 +00:00
|
|
|
resolver/is_storeable_test.cc
|
2021-11-11 16:07:12 +00:00
|
|
|
resolver/pipeline_overridable_constant_test.cc
|
2021-05-18 10:28:48 +00:00
|
|
|
resolver/ptr_ref_test.cc
|
|
|
|
resolver/ptr_ref_validation_test.cc
|
2021-12-03 15:49:34 +00:00
|
|
|
resolver/resolver_behavior_test.cc
|
2021-07-13 12:18:13 +00:00
|
|
|
resolver/resolver_constants_test.cc
|
2021-03-09 15:10:27 +00:00
|
|
|
resolver/resolver_test_helper.cc
|
|
|
|
resolver/resolver_test_helper.h
|
2021-03-09 15:12:57 +00:00
|
|
|
resolver/resolver_test.cc
|
2022-02-09 18:30:27 +00:00
|
|
|
resolver/side_effects_test.cc
|
2021-07-15 19:09:25 +00:00
|
|
|
resolver/storage_class_layout_validation_test.cc
|
2021-04-16 09:26:14 +00:00
|
|
|
resolver/storage_class_validation_test.cc
|
2021-03-15 10:43:11 +00:00
|
|
|
resolver/struct_layout_test.cc
|
2021-03-31 15:42:17 +00:00
|
|
|
resolver/struct_pipeline_stage_use_test.cc
|
2021-03-17 22:47:33 +00:00
|
|
|
resolver/struct_storage_class_use_test.cc
|
2021-03-31 12:46:52 +00:00
|
|
|
resolver/type_constructor_validation_test.cc
|
2021-03-18 17:59:54 +00:00
|
|
|
resolver/type_validation_test.cc
|
2021-03-09 15:12:57 +00:00
|
|
|
resolver/validation_test.cc
|
2021-05-18 10:28:48 +00:00
|
|
|
resolver/var_let_test.cc
|
|
|
|
resolver/var_let_validation_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
scope_stack_test.cc
|
2021-06-17 15:48:39 +00:00
|
|
|
sem/atomic_type_test.cc
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/bool_type_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
sem/builtin_test.cc
|
2021-07-26 22:19:48 +00:00
|
|
|
sem/depth_multisampled_texture_type_test.cc
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/depth_texture_type_test.cc
|
|
|
|
sem/external_texture_type_test.cc
|
|
|
|
sem/f32_type_test.cc
|
|
|
|
sem/i32_type_test.cc
|
|
|
|
sem/matrix_type_test.cc
|
|
|
|
sem/multisampled_texture_type_test.cc
|
|
|
|
sem/pointer_type_test.cc
|
2021-05-10 19:45:46 +00:00
|
|
|
sem/reference_type_test.cc
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/sampled_texture_type_test.cc
|
|
|
|
sem/sampler_type_test.cc
|
2021-05-07 20:58:34 +00:00
|
|
|
sem/sem_array_test.cc
|
2021-05-07 14:49:34 +00:00
|
|
|
sem/sem_struct_test.cc
|
2021-04-19 22:54:43 +00:00
|
|
|
sem/storage_texture_type_test.cc
|
|
|
|
sem/texture_type_test.cc
|
|
|
|
sem/type_manager_test.cc
|
|
|
|
sem/u32_type_test.cc
|
|
|
|
sem/vector_type_test.cc
|
2022-01-25 17:15:37 +00:00
|
|
|
source_test.cc
|
2021-11-11 16:07:12 +00:00
|
|
|
symbol_table_test.cc
|
|
|
|
symbol_test.cc
|
|
|
|
test_main.cc
|
|
|
|
traits_test.cc
|
|
|
|
transform/transform_test.cc
|
2022-01-24 21:07:20 +00:00
|
|
|
utils/crc32_test.cc
|
2021-07-08 10:00:17 +00:00
|
|
|
utils/defer_test.cc
|
2021-06-03 15:53:34 +00:00
|
|
|
utils/enum_set_test.cc
|
2021-03-29 15:13:55 +00:00
|
|
|
utils/hash_test.cc
|
2021-06-02 21:02:34 +00:00
|
|
|
utils/io/command_test.cc
|
|
|
|
utils/io/tmpfile_test.cc
|
2021-11-23 18:37:37 +00:00
|
|
|
utils/map_test.cc
|
2021-03-15 13:37:41 +00:00
|
|
|
utils/math_test.cc
|
2021-09-08 15:18:36 +00:00
|
|
|
utils/reverse_test.cc
|
2021-05-19 16:11:04 +00:00
|
|
|
utils/scoped_assignment_test.cc
|
2021-10-14 20:24:50 +00:00
|
|
|
utils/string_test.cc
|
2021-11-12 13:04:06 +00:00
|
|
|
utils/transform_test.cc
|
2021-02-17 13:10:49 +00:00
|
|
|
utils/unique_vector_test.cc
|
2021-03-22 21:05:47 +00:00
|
|
|
writer/append_vector_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/float_to_string_test.cc
|
2021-06-29 11:53:15 +00:00
|
|
|
writer/text_generator_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
)
|
2020-03-18 14:08:48 +00:00
|
|
|
|
2021-09-03 14:16:56 +00:00
|
|
|
# Inspector tests depend on WGSL reader
|
|
|
|
if(${TINT_BUILD_WGSL_READER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
inspector/inspector_test.cc
|
|
|
|
inspector/test_inspector_builder.cc
|
|
|
|
inspector/test_inspector_builder.h
|
|
|
|
inspector/test_inspector_runner.cc
|
|
|
|
inspector/test_inspector_runner.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-10-14 21:22:19 +00:00
|
|
|
if(${TINT_BUILD_SPV_READER} AND ${TINT_BUILD_WGSL_WRITER})
|
2020-12-09 14:47:30 +00:00
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
reader/spirv/enum_converter_test.cc
|
|
|
|
reader/spirv/fail_stream_test.cc
|
|
|
|
reader/spirv/function_arithmetic_test.cc
|
|
|
|
reader/spirv/function_bit_test.cc
|
|
|
|
reader/spirv/function_cfg_test.cc
|
|
|
|
reader/spirv/function_call_test.cc
|
|
|
|
reader/spirv/function_composite_test.cc
|
|
|
|
reader/spirv/function_conversion_test.cc
|
|
|
|
reader/spirv/function_decl_test.cc
|
|
|
|
reader/spirv/function_glsl_std_450_test.cc
|
|
|
|
reader/spirv/function_logical_test.cc
|
|
|
|
reader/spirv/function_memory_test.cc
|
|
|
|
reader/spirv/function_misc_test.cc
|
|
|
|
reader/spirv/function_var_test.cc
|
|
|
|
reader/spirv/namer_test.cc
|
2021-03-22 19:27:06 +00:00
|
|
|
reader/spirv/parser_impl_barrier_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/spirv/parser_impl_convert_member_decoration_test.cc
|
|
|
|
reader/spirv/parser_impl_convert_type_test.cc
|
|
|
|
reader/spirv/parser_impl_function_decl_test.cc
|
|
|
|
reader/spirv/parser_impl_get_decorations_test.cc
|
|
|
|
reader/spirv/parser_impl_handle_test.cc
|
|
|
|
reader/spirv/parser_impl_import_test.cc
|
|
|
|
reader/spirv/parser_impl_module_var_test.cc
|
|
|
|
reader/spirv/parser_impl_named_types_test.cc
|
2021-05-05 09:46:31 +00:00
|
|
|
reader/spirv/parser_impl_test_helper.cc
|
|
|
|
reader/spirv/parser_impl_test_helper.h
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/spirv/parser_impl_test.cc
|
|
|
|
reader/spirv/parser_impl_user_name_test.cc
|
2021-05-10 17:25:21 +00:00
|
|
|
reader/spirv/parser_type_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/spirv/parser_test.cc
|
|
|
|
reader/spirv/spirv_tools_helpers_test.cc
|
|
|
|
reader/spirv/spirv_tools_helpers_test.h
|
|
|
|
reader/spirv/usage_test.cc
|
|
|
|
)
|
2020-11-24 15:28:06 +00:00
|
|
|
endif()
|
2020-03-02 20:47:43 +00:00
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
if(${TINT_BUILD_WGSL_READER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
reader/wgsl/lexer_test.cc
|
|
|
|
reader/wgsl/parser_test.cc
|
|
|
|
reader/wgsl/parser_impl_additive_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_and_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_argument_expression_list_test.cc
|
|
|
|
reader/wgsl/parser_impl_assignment_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_body_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_break_stmt_test.cc
|
2021-02-19 20:01:43 +00:00
|
|
|
reader/wgsl/parser_impl_bug_cases_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_call_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_case_body_test.cc
|
|
|
|
reader/wgsl/parser_impl_const_expr_test.cc
|
|
|
|
reader/wgsl/parser_impl_const_literal_test.cc
|
|
|
|
reader/wgsl/parser_impl_continue_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_continuing_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_depth_texture_type_test.cc
|
2021-04-22 22:47:03 +00:00
|
|
|
reader/wgsl/parser_impl_external_texture_type_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_elseif_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_equality_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_error_msg_test.cc
|
|
|
|
reader/wgsl/parser_impl_error_resync_test.cc
|
|
|
|
reader/wgsl/parser_impl_exclusive_or_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_for_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_function_decl_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
reader/wgsl/parser_impl_function_attribute_list_test.cc
|
|
|
|
reader/wgsl/parser_impl_function_attribute_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_function_header_test.cc
|
|
|
|
reader/wgsl/parser_impl_global_constant_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_global_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_global_variable_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_if_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_inclusive_or_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_logical_and_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_logical_or_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_loop_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_multiplicative_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_param_list_test.cc
|
|
|
|
reader/wgsl/parser_impl_paren_rhs_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_pipeline_stage_test.cc
|
|
|
|
reader/wgsl/parser_impl_primary_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_relational_expression_test.cc
|
2021-07-05 21:48:37 +00:00
|
|
|
reader/wgsl/parser_impl_reserved_keyword_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_sampled_texture_type_test.cc
|
|
|
|
reader/wgsl/parser_impl_sampler_type_test.cc
|
|
|
|
reader/wgsl/parser_impl_shift_expression_test.cc
|
2021-04-29 15:02:15 +00:00
|
|
|
reader/wgsl/parser_impl_singular_expression_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_statement_test.cc
|
|
|
|
reader/wgsl/parser_impl_statements_test.cc
|
|
|
|
reader/wgsl/parser_impl_storage_class_test.cc
|
|
|
|
reader/wgsl/parser_impl_storage_texture_type_test.cc
|
|
|
|
reader/wgsl/parser_impl_struct_body_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_struct_decl_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
reader/wgsl/parser_impl_struct_attribute_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_struct_attribute_test.cc
|
|
|
|
reader/wgsl/parser_impl_struct_member_attribute_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_struct_member_attribute_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_struct_member_test.cc
|
|
|
|
reader/wgsl/parser_impl_switch_body_test.cc
|
|
|
|
reader/wgsl/parser_impl_switch_stmt_test.cc
|
|
|
|
reader/wgsl/parser_impl_test.cc
|
|
|
|
reader/wgsl/parser_impl_test_helper.cc
|
|
|
|
reader/wgsl/parser_impl_test_helper.h
|
2022-01-06 17:20:22 +00:00
|
|
|
reader/wgsl/parser_impl_texel_format_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_texture_sampler_types_test.cc
|
|
|
|
reader/wgsl/parser_impl_type_alias_test.cc
|
|
|
|
reader/wgsl/parser_impl_type_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_unary_expression_test.cc
|
|
|
|
reader/wgsl/parser_impl_variable_decl_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
reader/wgsl/parser_impl_variable_attribute_list_test.cc
|
|
|
|
reader/wgsl/parser_impl_variable_attribute_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/parser_impl_variable_ident_decl_test.cc
|
|
|
|
reader/wgsl/parser_impl_variable_stmt_test.cc
|
2021-06-04 20:41:47 +00:00
|
|
|
reader/wgsl/parser_impl_variable_qualifier_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
reader/wgsl/token_test.cc
|
|
|
|
)
|
|
|
|
endif()
|
2020-03-10 22:54:31 +00:00
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
if(${TINT_BUILD_SPV_WRITER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
writer/spirv/binary_writer_test.cc
|
|
|
|
writer/spirv/builder_accessor_expression_test.cc
|
|
|
|
writer/spirv/builder_assign_test.cc
|
|
|
|
writer/spirv/builder_binary_expression_test.cc
|
|
|
|
writer/spirv/builder_bitcast_expression_test.cc
|
|
|
|
writer/spirv/builder_block_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
writer/spirv/builder_builtin_test.cc
|
|
|
|
writer/spirv/builder_builtin_texture_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/spirv/builder_call_test.cc
|
|
|
|
writer/spirv/builder_constructor_expression_test.cc
|
|
|
|
writer/spirv/builder_discard_test.cc
|
2021-03-11 15:57:21 +00:00
|
|
|
writer/spirv/builder_entry_point_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/spirv/builder_format_conversion_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
writer/spirv/builder_function_attribute_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/spirv/builder_function_test.cc
|
|
|
|
writer/spirv/builder_function_variable_test.cc
|
|
|
|
writer/spirv/builder_global_variable_test.cc
|
|
|
|
writer/spirv/builder_ident_expression_test.cc
|
|
|
|
writer/spirv/builder_if_test.cc
|
|
|
|
writer/spirv/builder_literal_test.cc
|
|
|
|
writer/spirv/builder_loop_test.cc
|
|
|
|
writer/spirv/builder_return_test.cc
|
|
|
|
writer/spirv/builder_switch_test.cc
|
|
|
|
writer/spirv/builder_test.cc
|
|
|
|
writer/spirv/builder_type_test.cc
|
|
|
|
writer/spirv/builder_unary_op_expression_test.cc
|
|
|
|
writer/spirv/instruction_test.cc
|
|
|
|
writer/spirv/operand_test.cc
|
2021-03-22 15:32:35 +00:00
|
|
|
writer/spirv/scalar_constant_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/spirv/spv_dump.cc
|
|
|
|
writer/spirv/spv_dump.h
|
|
|
|
writer/spirv/test_helper.h
|
|
|
|
)
|
|
|
|
endif()
|
2020-03-18 14:08:48 +00:00
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
if(${TINT_BUILD_WGSL_WRITER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
writer/wgsl/generator_impl_test.cc
|
|
|
|
writer/wgsl/generator_impl_alias_type_test.cc
|
|
|
|
writer/wgsl/generator_impl_array_accessor_test.cc
|
|
|
|
writer/wgsl/generator_impl_assign_test.cc
|
|
|
|
writer/wgsl/generator_impl_binary_test.cc
|
|
|
|
writer/wgsl/generator_impl_bitcast_test.cc
|
|
|
|
writer/wgsl/generator_impl_block_test.cc
|
|
|
|
writer/wgsl/generator_impl_break_test.cc
|
|
|
|
writer/wgsl/generator_impl_call_test.cc
|
|
|
|
writer/wgsl/generator_impl_case_test.cc
|
|
|
|
writer/wgsl/generator_impl_cast_test.cc
|
|
|
|
writer/wgsl/generator_impl_constructor_test.cc
|
|
|
|
writer/wgsl/generator_impl_continue_test.cc
|
|
|
|
writer/wgsl/generator_impl_discard_test.cc
|
|
|
|
writer/wgsl/generator_impl_fallthrough_test.cc
|
|
|
|
writer/wgsl/generator_impl_function_test.cc
|
2021-02-10 15:34:37 +00:00
|
|
|
writer/wgsl/generator_impl_global_decl_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/wgsl/generator_impl_identifier_test.cc
|
|
|
|
writer/wgsl/generator_impl_if_test.cc
|
|
|
|
writer/wgsl/generator_impl_loop_test.cc
|
2021-05-27 20:46:46 +00:00
|
|
|
writer/wgsl/generator_impl_literal_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/wgsl/generator_impl_member_accessor_test.cc
|
|
|
|
writer/wgsl/generator_impl_return_test.cc
|
|
|
|
writer/wgsl/generator_impl_switch_test.cc
|
|
|
|
writer/wgsl/generator_impl_type_test.cc
|
|
|
|
writer/wgsl/generator_impl_unary_op_test.cc
|
|
|
|
writer/wgsl/generator_impl_variable_decl_statement_test.cc
|
|
|
|
writer/wgsl/generator_impl_variable_test.cc
|
|
|
|
writer/wgsl/test_helper.h
|
|
|
|
)
|
|
|
|
endif()
|
2020-03-18 14:08:48 +00:00
|
|
|
|
2021-01-06 12:57:41 +00:00
|
|
|
if(${TINT_BUILD_WGSL_READER} AND ${TINT_BUILD_WGSL_WRITER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
2021-09-07 18:59:21 +00:00
|
|
|
transform/add_empty_entry_point_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
transform/add_spirv_block_attribute_test.cc
|
2021-06-25 10:26:26 +00:00
|
|
|
transform/array_length_from_uniform_test.cc
|
2021-03-29 21:25:45 +00:00
|
|
|
transform/binding_remapper_test.cc
|
2021-04-09 10:28:48 +00:00
|
|
|
transform/calculate_array_length_test.cc
|
2021-03-31 17:44:27 +00:00
|
|
|
transform/canonicalize_entry_point_io_test.cc
|
2022-01-24 17:17:22 +00:00
|
|
|
transform/combine_samplers_test.cc
|
2021-06-18 21:15:25 +00:00
|
|
|
transform/decompose_memory_access_test.cc
|
2022-02-04 15:39:34 +00:00
|
|
|
transform/decompose_strided_array_test.cc
|
2021-07-27 08:17:29 +00:00
|
|
|
transform/decompose_strided_matrix_test.cc
|
2021-05-05 16:38:12 +00:00
|
|
|
transform/external_texture_transform_test.cc
|
2021-01-06 12:57:41 +00:00
|
|
|
transform/first_index_offset_test.cc
|
2021-06-18 14:59:51 +00:00
|
|
|
transform/fold_constants_test.cc
|
2021-07-02 21:15:44 +00:00
|
|
|
transform/fold_trivial_single_use_lets_test.cc
|
2021-07-08 10:00:17 +00:00
|
|
|
transform/for_loop_to_loop_test.cc
|
2021-12-13 15:55:11 +00:00
|
|
|
transform/localize_struct_array_assignment_test.cc
|
2021-07-02 22:17:25 +00:00
|
|
|
transform/loop_to_for_loop_test.cc
|
2021-09-07 18:59:21 +00:00
|
|
|
transform/module_scope_var_to_entry_point_param_test.cc
|
2021-11-17 12:10:16 +00:00
|
|
|
transform/multiplanar_external_texture_test.cc
|
2021-09-13 17:11:58 +00:00
|
|
|
transform/num_workgroups_from_uniform_test.cc
|
2021-06-16 09:50:11 +00:00
|
|
|
transform/pad_array_elements_test.cc
|
2022-02-10 18:50:38 +00:00
|
|
|
transform/promote_initializers_to_const_var_test.cc
|
2021-10-21 23:04:44 +00:00
|
|
|
transform/remove_phonies_test.cc
|
2021-12-03 17:51:48 +00:00
|
|
|
transform/remove_unreachable_statements_test.cc
|
2021-03-04 11:12:45 +00:00
|
|
|
transform/renamer_test.cc
|
2021-06-30 13:23:36 +00:00
|
|
|
transform/robustness_test.cc
|
2021-11-23 20:45:51 +00:00
|
|
|
transform/simplify_pointers_test.cc
|
2021-05-21 21:01:23 +00:00
|
|
|
transform/single_entry_point_test.cc
|
2021-01-06 12:57:41 +00:00
|
|
|
transform/test_helper.h
|
2021-11-23 20:45:51 +00:00
|
|
|
transform/unshadow_test.cc
|
2022-02-10 18:50:38 +00:00
|
|
|
transform/var_for_dynamic_index_test.cc
|
2021-11-23 20:45:51 +00:00
|
|
|
transform/vectorize_scalar_matrix_constructors_test.cc
|
2021-01-06 12:57:41 +00:00
|
|
|
transform/vertex_pulling_test.cc
|
2021-06-16 09:19:36 +00:00
|
|
|
transform/wrap_arrays_in_structs_test.cc
|
2021-06-18 22:44:31 +00:00
|
|
|
transform/zero_init_workgroup_memory_test.cc
|
2022-02-10 18:50:38 +00:00
|
|
|
transform/utils/hoist_to_decl_before_test.cc
|
2021-01-06 12:57:41 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
if(${TINT_BUILD_MSL_WRITER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
writer/msl/generator_impl_array_accessor_test.cc
|
|
|
|
writer/msl/generator_impl_assign_test.cc
|
|
|
|
writer/msl/generator_impl_binary_test.cc
|
|
|
|
writer/msl/generator_impl_bitcast_test.cc
|
|
|
|
writer/msl/generator_impl_block_test.cc
|
|
|
|
writer/msl/generator_impl_break_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
writer/msl/generator_impl_builtin_test.cc
|
|
|
|
writer/msl/generator_impl_builtin_texture_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/msl/generator_impl_call_test.cc
|
|
|
|
writer/msl/generator_impl_case_test.cc
|
|
|
|
writer/msl/generator_impl_cast_test.cc
|
|
|
|
writer/msl/generator_impl_constructor_test.cc
|
|
|
|
writer/msl/generator_impl_continue_test.cc
|
|
|
|
writer/msl/generator_impl_discard_test.cc
|
|
|
|
writer/msl/generator_impl_function_test.cc
|
|
|
|
writer/msl/generator_impl_identifier_test.cc
|
|
|
|
writer/msl/generator_impl_if_test.cc
|
|
|
|
writer/msl/generator_impl_import_test.cc
|
|
|
|
writer/msl/generator_impl_loop_test.cc
|
|
|
|
writer/msl/generator_impl_member_accessor_test.cc
|
|
|
|
writer/msl/generator_impl_module_constant_test.cc
|
|
|
|
writer/msl/generator_impl_return_test.cc
|
2021-11-19 04:11:33 +00:00
|
|
|
writer/msl/generator_impl_sanitizer_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/msl/generator_impl_switch_test.cc
|
|
|
|
writer/msl/generator_impl_test.cc
|
|
|
|
writer/msl/generator_impl_type_test.cc
|
|
|
|
writer/msl/generator_impl_unary_op_test.cc
|
|
|
|
writer/msl/generator_impl_variable_decl_statement_test.cc
|
|
|
|
writer/msl/test_helper.h
|
|
|
|
)
|
|
|
|
endif()
|
2020-06-23 17:48:40 +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
|
|
|
if (${TINT_BUILD_GLSL_WRITER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
writer/glsl/generator_impl_array_accessor_test.cc
|
|
|
|
writer/glsl/generator_impl_assign_test.cc
|
|
|
|
writer/glsl/generator_impl_binary_test.cc
|
|
|
|
writer/glsl/generator_impl_bitcast_test.cc
|
|
|
|
writer/glsl/generator_impl_block_test.cc
|
|
|
|
writer/glsl/generator_impl_break_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
writer/glsl/generator_impl_builtin_test.cc
|
|
|
|
writer/glsl/generator_impl_builtin_texture_test.cc
|
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
|
|
|
writer/glsl/generator_impl_call_test.cc
|
|
|
|
writer/glsl/generator_impl_case_test.cc
|
|
|
|
writer/glsl/generator_impl_cast_test.cc
|
|
|
|
writer/glsl/generator_impl_constructor_test.cc
|
|
|
|
writer/glsl/generator_impl_continue_test.cc
|
|
|
|
writer/glsl/generator_impl_discard_test.cc
|
|
|
|
writer/glsl/generator_impl_function_test.cc
|
|
|
|
writer/glsl/generator_impl_identifier_test.cc
|
|
|
|
writer/glsl/generator_impl_if_test.cc
|
|
|
|
writer/glsl/generator_impl_import_test.cc
|
|
|
|
writer/glsl/generator_impl_loop_test.cc
|
|
|
|
writer/glsl/generator_impl_member_accessor_test.cc
|
|
|
|
writer/glsl/generator_impl_module_constant_test.cc
|
|
|
|
writer/glsl/generator_impl_return_test.cc
|
|
|
|
writer/glsl/generator_impl_sanitizer_test.cc
|
2022-02-09 17:44:17 +00:00
|
|
|
writer/glsl/generator_impl_storage_buffer_test.cc
|
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
|
|
|
writer/glsl/generator_impl_switch_test.cc
|
|
|
|
writer/glsl/generator_impl_test.cc
|
|
|
|
writer/glsl/generator_impl_type_test.cc
|
|
|
|
writer/glsl/generator_impl_unary_op_test.cc
|
2022-02-09 17:44:17 +00:00
|
|
|
writer/glsl/generator_impl_uniform_buffer_test.cc
|
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
|
|
|
writer/glsl/generator_impl_variable_decl_statement_test.cc
|
|
|
|
writer/glsl/generator_impl_workgroup_var_test.cc
|
|
|
|
writer/glsl/test_helper.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
if (${TINT_BUILD_HLSL_WRITER})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
writer/hlsl/generator_impl_array_accessor_test.cc
|
|
|
|
writer/hlsl/generator_impl_assign_test.cc
|
|
|
|
writer/hlsl/generator_impl_binary_test.cc
|
|
|
|
writer/hlsl/generator_impl_bitcast_test.cc
|
|
|
|
writer/hlsl/generator_impl_block_test.cc
|
|
|
|
writer/hlsl/generator_impl_break_test.cc
|
2022-02-02 23:07:11 +00:00
|
|
|
writer/hlsl/generator_impl_builtin_test.cc
|
|
|
|
writer/hlsl/generator_impl_builtin_texture_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/hlsl/generator_impl_call_test.cc
|
|
|
|
writer/hlsl/generator_impl_case_test.cc
|
|
|
|
writer/hlsl/generator_impl_cast_test.cc
|
|
|
|
writer/hlsl/generator_impl_constructor_test.cc
|
|
|
|
writer/hlsl/generator_impl_continue_test.cc
|
|
|
|
writer/hlsl/generator_impl_discard_test.cc
|
|
|
|
writer/hlsl/generator_impl_function_test.cc
|
|
|
|
writer/hlsl/generator_impl_identifier_test.cc
|
|
|
|
writer/hlsl/generator_impl_if_test.cc
|
|
|
|
writer/hlsl/generator_impl_import_test.cc
|
|
|
|
writer/hlsl/generator_impl_loop_test.cc
|
|
|
|
writer/hlsl/generator_impl_member_accessor_test.cc
|
|
|
|
writer/hlsl/generator_impl_module_constant_test.cc
|
|
|
|
writer/hlsl/generator_impl_return_test.cc
|
2021-03-01 22:51:39 +00:00
|
|
|
writer/hlsl/generator_impl_sanitizer_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/hlsl/generator_impl_switch_test.cc
|
|
|
|
writer/hlsl/generator_impl_test.cc
|
|
|
|
writer/hlsl/generator_impl_type_test.cc
|
|
|
|
writer/hlsl/generator_impl_unary_op_test.cc
|
|
|
|
writer/hlsl/generator_impl_variable_decl_statement_test.cc
|
2021-03-30 20:55:08 +00:00
|
|
|
writer/hlsl/generator_impl_workgroup_var_test.cc
|
2020-12-09 14:47:30 +00:00
|
|
|
writer/hlsl/test_helper.h
|
|
|
|
)
|
|
|
|
endif()
|
2020-06-23 17:48:40 +00:00
|
|
|
|
2021-11-24 14:55:05 +00:00
|
|
|
if (${TINT_BUILD_FUZZERS})
|
|
|
|
list(APPEND TINT_TEST_SRCS
|
|
|
|
../fuzzers/mersenne_twister_engine.cc
|
|
|
|
../fuzzers/mersenne_twister_engine.h
|
|
|
|
../fuzzers/random_generator.cc
|
|
|
|
../fuzzers/random_generator.h
|
|
|
|
../fuzzers/random_generator_engine.cc
|
|
|
|
../fuzzers/random_generator_engine.h
|
|
|
|
../fuzzers/random_generator_test.cc
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
add_executable(tint_unittests ${TINT_TEST_SRCS})
|
2022-01-18 18:58:16 +00:00
|
|
|
set_target_properties(${target} PROPERTIES FOLDER "Tests")
|
2020-07-20 22:13:37 +00:00
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
if(NOT MSVC)
|
|
|
|
target_compile_options(tint_unittests PRIVATE
|
|
|
|
-Wno-global-constructors
|
|
|
|
-Wno-weak-vtables
|
|
|
|
)
|
|
|
|
endif()
|
2020-03-18 14:08:48 +00:00
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
## Test executable
|
|
|
|
target_include_directories(
|
|
|
|
tint_unittests PRIVATE ${gmock_SOURCE_DIR}/include)
|
2021-06-11 13:22:27 +00:00
|
|
|
target_link_libraries(tint_unittests libtint gmock tint_utils_io)
|
2020-12-09 14:47:30 +00:00
|
|
|
tint_default_compile_options(tint_unittests)
|
2020-03-02 20:47:43 +00:00
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER})
|
|
|
|
tint_spvtools_compile_options(tint_unittests)
|
|
|
|
endif()
|
2020-03-02 20:47:43 +00:00
|
|
|
|
2020-12-09 14:47:30 +00:00
|
|
|
add_test(NAME tint_unittests COMMAND tint_unittests)
|
2022-01-18 18:58:16 +00:00
|
|
|
endif(TINT_BUILD_TESTS)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Benchmarks
|
|
|
|
################################################################################
|
|
|
|
if(TINT_BUILD_BENCHMARKS)
|
|
|
|
if(NOT TINT_BUILD_WGSL_READER)
|
|
|
|
message(FATAL_ERROR "TINT_BUILD_BENCHMARKS requires TINT_BUILD_WGSL_READER")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(TINT_BENCHMARK_SRC
|
2022-02-04 15:38:23 +00:00
|
|
|
"castable_bench.cc"
|
2022-01-31 19:49:00 +00:00
|
|
|
"bench/benchmark.cc"
|
2022-01-18 18:58:16 +00:00
|
|
|
"reader/wgsl/parser_bench.cc"
|
|
|
|
)
|
|
|
|
|
|
|
|
if (${TINT_BUILD_GLSL_WRITER})
|
|
|
|
list(APPEND TINT_BENCHMARK_SRC writer/glsl/generator_bench.cc)
|
|
|
|
endif()
|
|
|
|
if (${TINT_BUILD_HLSL_WRITER})
|
|
|
|
list(APPEND TINT_BENCHMARK_SRC writer/hlsl/generator_bench.cc)
|
|
|
|
endif()
|
|
|
|
if (${TINT_BUILD_MSL_WRITER})
|
|
|
|
list(APPEND TINT_BENCHMARK_SRC writer/msl/generator_bench.cc)
|
|
|
|
endif()
|
|
|
|
if (${TINT_BUILD_SPV_WRITER})
|
|
|
|
list(APPEND TINT_BENCHMARK_SRC writer/spirv/generator_bench.cc)
|
|
|
|
endif()
|
|
|
|
if (${TINT_BUILD_WGSL_WRITER})
|
|
|
|
list(APPEND TINT_BENCHMARK_SRC writer/wgsl/generator_bench.cc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(tint-benchmark ${TINT_BENCHMARK_SRC})
|
|
|
|
set_target_properties(${target} PROPERTIES FOLDER "Benchmarks")
|
|
|
|
|
|
|
|
tint_core_compile_options(tint-benchmark)
|
|
|
|
|
|
|
|
target_link_libraries(tint-benchmark PRIVATE benchmark::benchmark libtint)
|
|
|
|
endif(TINT_BUILD_BENCHMARKS)
|