Hash :
f251995d
Author :
Date :
2019-10-24T12:42:36
Capture/Replay: Write capture index file. This file will be used with multi-frame captures to share common code. Common code is global state, resource maps, and a list of frame replay functions. This should make converting a CPP replay into a functional test quite a bit simpler. The replay files will now be something like: angle_capture_context1.cpp angle_capture_context1.h angle_capture_context1_frame000.cpp angle_capture_context1_frame001.cpp ... etc Also adds a template for adding a capture/replay sample. Instructions are located in samples/BUILD.gn and docs in doc/CaptureAndReplay.md. Bug: angleproject:3611 Change-Id: I437b338fd84689d670a7d9e3e219d9334de25fd8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869543 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
# Copyright 2017 The Chromium 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("../gni/angle.gni")
angle_executable("shader_translator") {
sources = [
"shader_translator/shader_translator.cpp",
]
include_dirs = [ "../include" ]
deps = [
"../:translator",
]
}
config("sample_util_config") {
include_dirs = [ "sample_util" ]
}
angle_static_library("sample_util") {
sources = [
"sample_util/SampleApplication.cpp",
"sample_util/SampleApplication.h",
"sample_util/texture_utils.cpp",
"sample_util/texture_utils.h",
"sample_util/tga_utils.cpp",
"sample_util/tga_utils.h",
]
data_deps = [
"../:libEGL",
"../:libGLESv1_CM",
"../:libGLESv2",
]
public_deps = [
"../:angle_common",
"../:angle_util",
"../:angle_util_loader_headers",
]
configs += [ "../:library_name_config" ]
public_configs = [
":sample_util_config",
"../:no_gl_prototypes",
]
}
template("angle_sample") {
if (defined(invoker.data)) {
copy(target_name + "_data") {
sources = invoker.data
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}
angle_executable(target_name) {
forward_variables_from(invoker,
[
"sources",
"cflags",
])
deps = [
":sample_util",
]
if (defined(invoker.data)) {
deps += [ ":${target_name}_data" ]
}
if (defined(invoker.suppressed_configs)) {
suppressed_configs += invoker.suppressed_configs
}
}
}
angle_sample("hello_triangle") {
sources = [
"hello_triangle/HelloTriangle.cpp",
]
}
angle_sample("mip_map_2d") {
sources = [
"mip_map_2d/MipMap2D.cpp",
]
}
angle_sample("multi_texture") {
sources = [
"multi_texture/MultiTexture.cpp",
]
data = [
"multi_texture/basemap.tga",
"multi_texture/lightmap.tga",
]
}
angle_sample("multi_window") {
sources = [
"multi_window/MultiWindow.cpp",
]
}
angle_sample("multiple_draw_buffers") {
sources = [
"multiple_draw_buffers/MultipleDrawBuffers.cpp",
]
data = [
"multiple_draw_buffers/multiple_draw_buffers_copy_fs.glsl",
"multiple_draw_buffers/multiple_draw_buffers_fs.glsl",
"multiple_draw_buffers/multiple_draw_buffers_vs.glsl",
]
}
angle_sample("multiview") {
sources = [
"multiview/Multiview.cpp",
]
}
angle_sample("particle_system") {
sources = [
"particle_system/ParticleSystem.cpp",
]
data = [
"particle_system/smoke.tga",
]
}
angle_sample("post_sub_buffer") {
sources = [
"post_sub_buffer/PostSubBuffer.cpp",
]
}
angle_sample("simple_instancing") {
sources = [
"simple_instancing/SimpleInstancing.cpp",
]
}
angle_sample("simple_texture_2d") {
sources = [
"simple_texture_2d/SimpleTexture2D.cpp",
]
}
angle_sample("simple_texture_cubemap") {
sources = [
"simple_texture_cubemap/SimpleTextureCubemap.cpp",
]
}
angle_sample("simple_vertex_shader") {
sources = [
"simple_vertex_shader/SimpleVertexShader.cpp",
]
}
angle_sample("stencil_operations") {
sources = [
"stencil_operations/StencilOperations.cpp",
]
}
angle_sample("tex_redef_microbench") {
sources = [
"tex_redef_microbench/TexRedefMicroBench.cpp",
]
}
angle_sample("texture_wrap") {
sources = [
"texture_wrap/TextureWrap.cpp",
]
}
angle_sample("tri_fan_microbench") {
sources = [
"tri_fan_microbench/TriFanMicroBench.cpp",
]
}
angle_sample("window_test") {
sources = [
"WindowTest/WindowTest.cpp",
]
}
angle_sample("gles1_hello_triangle") {
sources = [
"gles1/HelloTriangle.cpp",
]
}
angle_sample("gles1_simple_texture_2d") {
sources = [
"gles1/SimpleTexture2D.cpp",
]
}
angle_sample("gles1_simple_lighting") {
sources = [
"gles1/SimpleLighting.cpp",
]
}
angle_sample("gles1_flat_shading") {
sources = [
"gles1/FlatShading.cpp",
]
}
angle_sample("gles1_draw_texture") {
sources = [
"gles1/DrawTexture.cpp",
]
}
template("capture_replay") {
angle_sample(target_name) {
sources = invoker.sources + [
"capture_replay/CaptureReplay.cpp",
"capture_replay/angle_capture_context1.cpp",
"capture_replay/angle_capture_context1.h",
]
suppressed_configs = [ "$angle_root:constructor_and_destructor_warnings" ]
}
}
# The capture_replay sample is set up to work with a single Context.
# To use the capture replay sample fist move your capture sources into
# the capture_replay folder. Uncomment and update this target:
# capture_replay("my_sample") {
# sources = [
# "capture_replay/angle_capture_context1_frame000.cpp",
# "capture_replay/angle_capture_context1_frame001.cpp",
# "capture_replay/angle_capture_context1_frame002.cpp",
# "capture_replay/angle_capture_context1_frame003.cpp",
# "capture_replay/angle_capture_context1_frame004.cpp",
# ]
# }
group("all") {
testonly = true
deps = [
":gles1_draw_texture",
":gles1_flat_shading",
":gles1_hello_triangle",
":gles1_simple_lighting",
":gles1_simple_texture_2d",
":hello_triangle",
":mip_map_2d",
":multi_texture",
":multi_window",
":multiple_draw_buffers",
":multiview",
":particle_system",
":post_sub_buffer",
":sample_util",
":simple_instancing",
":simple_texture_2d",
":simple_texture_cubemap",
":simple_vertex_shader",
":stencil_operations",
":tex_redef_microbench",
":texture_wrap",
":tri_fan_microbench",
":window_test",
]
}