| 1 |
load("@py_deps//:requirements.bzl", "requirement") |
| 2 |
load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 3 |
load("@rules_python//python:defs.bzl", "py_binary") |
| 4 |
|
| 5 |
# This file will be copied into //third_party/externals/dawn via the new_local_repository |
| 6 |
# rule in WORKSPACE.bazel, so all files should be relative to that path. |
| 7 |
|
| 8 |
# We define this here because the emscripten toolchain calls the cpu wasm, whereas the |
| 9 |
# bazelbuild/platforms call it wasm32. https://github.com/emscripten-core/emsdk/issues/919 |
| 10 |
config_setting( |
| 11 |
name = "cpu_wasm", |
| 12 |
values = { |
| 13 |
"cpu": "wasm", |
| 14 |
}, |
| 15 |
) |
| 16 |
|
| 17 |
py_binary( |
| 18 |
name = "dawn_json_generator", |
| 19 |
srcs = [ |
| 20 |
"generator/dawn_json_generator.py", |
| 21 |
"generator/generator_lib.py", |
| 22 |
], |
| 23 |
deps = [ |
| 24 |
requirement("jinja2"), |
| 25 |
# jinja2 has a dep on MarkupSafe. Declaring MarkupSafe here is not necessary, but it makes |
| 26 |
# the link easier to find than searching the Bazel cache for generated deps. |
| 27 |
requirement("MarkupSafe"), |
| 28 |
], |
| 29 |
) |
| 30 |
|
| 31 |
genrule( |
| 32 |
name = "generate_webgpu_cpp", |
| 33 |
srcs = [ |
| 34 |
"generator/templates/api_cpp.h", |
| 35 |
"generator/templates/api_cpp_chained_struct.h", |
| 36 |
"generator/templates/api_cpp_print.h", |
| 37 |
"generator/templates/BSD_LICENSE", |
| 38 |
"dawn.json", |
| 39 |
"dawn_wire.json", |
| 40 |
], |
| 41 |
outs = [ |
| 42 |
"include/dawn/webgpu_cpp.h", |
| 43 |
"include/dawn/webgpu_cpp_chained_struct.h", |
| 44 |
"include/dawn/webgpu_cpp_print.h", |
| 45 |
], |
| 46 |
cmd = "$(location :dawn_json_generator) " + |
| 47 |
"--dawn-json $(location dawn.json) " + |
| 48 |
"--wire-json $(location dawn_wire.json) " + |
| 49 |
"--template-dir $$(dirname $(location generator/templates/api_cpp.h)) " + |
| 50 |
"--targets cpp_headers " + |
| 51 |
"--output-dir $(RULEDIR)", |
| 52 |
tools = [":dawn_json_generator"], |
| 53 |
) |
| 54 |
|
| 55 |
genrule( |
| 56 |
name = "generate_webgpu", |
| 57 |
srcs = [ |
| 58 |
"generator/templates/api.h", |
| 59 |
"generator/templates/dawn_proc_table.h", |
| 60 |
"generator/templates/BSD_LICENSE", |
| 61 |
"dawn.json", |
| 62 |
"dawn_wire.json", |
| 63 |
], |
| 64 |
outs = [ |
| 65 |
"include/dawn/webgpu.h", |
| 66 |
"include/dawn/dawn_proc_table.h", |
| 67 |
], |
| 68 |
cmd = "$(location :dawn_json_generator) " + |
| 69 |
"--dawn-json $(location dawn.json) " + |
| 70 |
"--wire-json $(location dawn_wire.json) " + |
| 71 |
"--template-dir $$(dirname $(location generator/templates/api.h)) " + |
| 72 |
"--targets headers " + |
| 73 |
"--output-dir $(RULEDIR)", |
| 74 |
tools = [":dawn_json_generator"], |
| 75 |
) |
| 76 |
|
| 77 |
genrule( |
| 78 |
name = "generate_proc", |
| 79 |
srcs = [ |
| 80 |
"dawn.json", |
| 81 |
"dawn_wire.json", |
| 82 |
"generator/templates/BSD_LICENSE", |
| 83 |
"generator/templates/dawn_proc.c", |
| 84 |
"generator/templates/dawn_thread_dispatch_proc.cpp", |
| 85 |
], |
| 86 |
outs = [ |
| 87 |
"src/dawn/dawn_proc.c", |
| 88 |
"src/dawn/dawn_thread_dispatch_proc.cpp", |
| 89 |
], |
| 90 |
cmd = "$(location :dawn_json_generator) " + |
| 91 |
"--dawn-json $(location dawn.json) " + |
| 92 |
"--wire-json $(location dawn_wire.json) " + |
| 93 |
"--template-dir $$(dirname $(location generator/templates/BSD_LICENSE)) " + |
| 94 |
"--targets proc " + |
| 95 |
"--output-dir $(RULEDIR)", |
| 96 |
tools = [":dawn_json_generator"], |
| 97 |
) |
| 98 |
|
| 99 |
genrule( |
| 100 |
name = "generate_dawn_cpp", |
| 101 |
srcs = [ |
| 102 |
"dawn.json", |
| 103 |
"dawn_wire.json", |
| 104 |
"generator/templates/BSD_LICENSE", |
| 105 |
"generator/templates/api_cpp.cpp", |
| 106 |
], |
| 107 |
outs = [ |
| 108 |
"src/dawn/webgpu_cpp.cpp", |
| 109 |
], |
| 110 |
cmd = "$(location :dawn_json_generator) " + |
| 111 |
"--dawn-json $(location dawn.json) " + |
| 112 |
"--wire-json $(location dawn_wire.json) " + |
| 113 |
"--template-dir $$(dirname $(location generator/templates/BSD_LICENSE)) " + |
| 114 |
"--targets cpp " + |
| 115 |
"--output-dir $(RULEDIR)", |
| 116 |
tools = [":dawn_json_generator"], |
| 117 |
) |
| 118 |
|
| 119 |
genrule( |
| 120 |
name = "generate_utils", |
| 121 |
srcs = [ |
| 122 |
"dawn.json", |
| 123 |
"dawn_wire.json", |
| 124 |
"generator/templates/BSD_LICENSE", |
| 125 |
"generator/templates/dawn/native/ChainUtils.cpp", |
| 126 |
"generator/templates/dawn/native/ChainUtils.h", |
| 127 |
"generator/templates/dawn/native/Features.h", |
| 128 |
"generator/templates/dawn/native/Features.inl", |
| 129 |
"generator/templates/dawn/native/ObjectType.cpp", |
| 130 |
"generator/templates/dawn/native/ObjectType.h", |
| 131 |
"generator/templates/dawn/native/ProcTable.cpp", |
| 132 |
"generator/templates/dawn/native/ValidationUtils.cpp", |
| 133 |
"generator/templates/dawn/native/ValidationUtils.h", |
| 134 |
"generator/templates/dawn/native/api_StreamImpl.cpp", |
| 135 |
"generator/templates/dawn/native/api_absl_format.cpp", |
| 136 |
"generator/templates/dawn/native/api_absl_format.h", |
| 137 |
"generator/templates/dawn/native/api_structs.cpp", |
| 138 |
"generator/templates/dawn/native/api_structs.h", |
| 139 |
"generator/templates/dawn/native/dawn_platform.h", |
| 140 |
], |
| 141 |
outs = [ |
| 142 |
"src/dawn/native/ChainUtils_autogen.cpp", |
| 143 |
"src/dawn/native/ChainUtils_autogen.h", |
| 144 |
"src/dawn/native/Features_autogen.h", |
| 145 |
"src/dawn/native/Features_autogen.inl", |
| 146 |
"src/dawn/native/ObjectType_autogen.cpp", |
| 147 |
"src/dawn/native/ObjectType_autogen.h", |
| 148 |
"src/dawn/native/ProcTable.cpp", |
| 149 |
"src/dawn/native/ValidationUtils_autogen.cpp", |
| 150 |
"src/dawn/native/ValidationUtils_autogen.h", |
| 151 |
"src/dawn/native/dawn_platform_autogen.h", |
| 152 |
"src/dawn/native/webgpu_StreamImpl_autogen.cpp", |
| 153 |
"src/dawn/native/webgpu_absl_format_autogen.cpp", |
| 154 |
"src/dawn/native/webgpu_absl_format_autogen.h", |
| 155 |
"src/dawn/native/wgpu_structs_autogen.cpp", |
| 156 |
"src/dawn/native/wgpu_structs_autogen.h", |
| 157 |
], |
| 158 |
cmd = "$(location :dawn_json_generator) " + |
| 159 |
"--dawn-json $(location dawn.json) " + |
| 160 |
"--wire-json $(location dawn_wire.json) " + |
| 161 |
"--template-dir $$(dirname $(location generator/templates/BSD_LICENSE)) " + |
| 162 |
"--targets native_utils " + |
| 163 |
"--output-dir $(RULEDIR)", |
| 164 |
tools = [":dawn_json_generator"], |
| 165 |
) |
| 166 |
|
| 167 |
py_binary( |
| 168 |
name = "dawn_gpu_info_generator", |
| 169 |
srcs = [ |
| 170 |
"generator/dawn_gpu_info_generator.py", |
| 171 |
"generator/generator_lib.py", |
| 172 |
], |
| 173 |
deps = [ |
| 174 |
requirement("jinja2"), |
| 175 |
# jinja2 has a dep on MarkupSafe. Declaring MarkupSafe here is not necessary, but it makes |
| 176 |
# the link easier to find than searching the Bazel cache for generated deps. |
| 177 |
requirement("MarkupSafe"), |
| 178 |
], |
| 179 |
) |
| 180 |
|
| 181 |
genrule( |
| 182 |
name = "generate_gpuinfo", |
| 183 |
srcs = [ |
| 184 |
"src/dawn/gpu_info.json", |
| 185 |
"generator/templates/BSD_LICENSE", |
| 186 |
"generator/templates/dawn/common/GPUInfo.h", |
| 187 |
"generator/templates/dawn/common/GPUInfo.cpp", |
| 188 |
], |
| 189 |
outs = [ |
| 190 |
"src/dawn/common/GPUInfo_autogen.h", |
| 191 |
"src/dawn/common/GPUInfo_autogen.cpp", |
| 192 |
], |
| 193 |
cmd = "$(location :dawn_gpu_info_generator) " + |
| 194 |
"--gpu-info-json $(location src/dawn/gpu_info.json) " + |
| 195 |
"--template-dir $$(dirname $(location generator/templates/BSD_LICENSE)) " + |
| 196 |
"--output-dir $(RULEDIR)", |
| 197 |
tools = [":dawn_gpu_info_generator"], |
| 198 |
) |
| 199 |
|
| 200 |
py_binary( |
| 201 |
name = "dawn_version_generator", |
| 202 |
srcs = [ |
| 203 |
"generator/dawn_version_generator.py", |
| 204 |
"generator/generator_lib.py", |
| 205 |
], |
| 206 |
deps = [ |
| 207 |
requirement("jinja2"), |
| 208 |
# jinja2 has a dep on MarkupSafe. Declaring MarkupSafe here is not necessary, but it makes |
| 209 |
# the link easier to find than searching the Bazel cache for generated deps. |
| 210 |
requirement("MarkupSafe"), |
| 211 |
], |
| 212 |
) |
| 213 |
|
| 214 |
# This currently has a blank version, which "disables caching" according to |
| 215 |
# https://dawn.googlesource.com/dawn/+/bd30d9e594226e96c07ec3cd46dbdc68928aef41/generator/dawn_version_generator.py#39 |
| 216 |
# We don't anticipate that being a real issue. Should we need to make this work, |
| 217 |
# the easiest way is to use cat to read in .git/HEAD and specify that directly |
| 218 |
# to the dawn_version_generator script (which needs a patch to accept that argument. |
| 219 |
genrule( |
| 220 |
name = "generate_version", |
| 221 |
srcs = [ |
| 222 |
"generator/templates/BSD_LICENSE", |
| 223 |
"generator/templates/dawn/common/Version.h", |
| 224 |
], |
| 225 |
outs = [ |
| 226 |
"src/dawn/common/Version_autogen.h", |
| 227 |
], |
| 228 |
cmd = "$(location :dawn_version_generator) " + |
| 229 |
"--template-dir $$(dirname $(location generator/templates/BSD_LICENSE)) " + |
| 230 |
"--dawn-dir $$(dirname $(location generator/templates/BSD_LICENSE)) " + |
| 231 |
"--output-dir $(RULEDIR) 2> /dev/null", |
| 232 |
tools = [":dawn_version_generator"], |
| 233 |
) |
| 234 |
|
| 235 |
DAWN_HDRS = [ |
| 236 |
"include/dawn/EnumClassBitmasks.h", |
| 237 |
"include/dawn/dawn_proc.h", |
| 238 |
"include/dawn/dawn_thread_dispatch_proc.h", |
| 239 |
"include/dawn/native/D3D12Backend.h", |
| 240 |
"include/dawn/native/DawnNative.h", |
| 241 |
"include/dawn/native/MetalBackend.h", |
| 242 |
"include/dawn/native/NullBackend.h", |
| 243 |
"include/dawn/native/OpenGLBackend.h", |
| 244 |
"include/dawn/native/VulkanBackend.h", |
| 245 |
"include/dawn/native/dawn_native_export.h", |
| 246 |
"include/dawn/platform/DawnPlatform.h", |
| 247 |
"include/dawn/platform/dawn_platform_export.h", |
| 248 |
"include/dawn/wire/Wire.h", |
| 249 |
"include/dawn/wire/WireClient.h", |
| 250 |
"include/dawn/wire/WireServer.h", |
| 251 |
"include/dawn/wire/dawn_wire_export.h", |
| 252 |
"include/webgpu/webgpu.h", |
| 253 |
"include/webgpu/webgpu_cpp.h", |
| 254 |
] |
| 255 |
|
| 256 |
DAWN_SRCS = [ |
| 257 |
# Generated files |
| 258 |
"include/dawn/dawn_proc_table.h", |
| 259 |
"include/dawn/webgpu.h", |
| 260 |
"include/dawn/webgpu_cpp.h", |
| 261 |
"include/dawn/webgpu_cpp_chained_struct.h", |
| 262 |
# From dawn/src/dawn/native/BUILD.gn:sources |
| 263 |
"src/dawn/native/DawnNative.cpp", |
| 264 |
"src/dawn/native/Adapter.cpp", |
| 265 |
"src/dawn/native/Adapter.h", |
| 266 |
"src/dawn/native/ApplyClearColorValueWithDrawHelper.cpp", |
| 267 |
"src/dawn/native/ApplyClearColorValueWithDrawHelper.h", |
| 268 |
"src/dawn/native/AsyncTask.cpp", |
| 269 |
"src/dawn/native/AsyncTask.h", |
| 270 |
"src/dawn/native/AttachmentState.cpp", |
| 271 |
"src/dawn/native/AttachmentState.h", |
| 272 |
"src/dawn/native/BackendConnection.cpp", |
| 273 |
"src/dawn/native/BackendConnection.h", |
| 274 |
"src/dawn/native/BindGroup.cpp", |
| 275 |
"src/dawn/native/BindGroup.h", |
| 276 |
"src/dawn/native/BindGroupLayout.cpp", |
| 277 |
"src/dawn/native/BindGroupLayout.h", |
| 278 |
"src/dawn/native/BindGroupLayoutInternal.cpp", |
| 279 |
"src/dawn/native/BindGroupLayoutInternal.h", |
| 280 |
"src/dawn/native/BindGroupTracker.h", |
| 281 |
"src/dawn/native/BindingInfo.cpp", |
| 282 |
"src/dawn/native/BindingInfo.h", |
| 283 |
"src/dawn/native/BlitBufferToDepthStencil.cpp", |
| 284 |
"src/dawn/native/BlitBufferToDepthStencil.h", |
| 285 |
"src/dawn/native/BlitColorToColorWithDraw.cpp", |
| 286 |
"src/dawn/native/BlitColorToColorWithDraw.h", |
| 287 |
"src/dawn/native/BlitDepthToDepth.cpp", |
| 288 |
"src/dawn/native/BlitDepthToDepth.h", |
| 289 |
"src/dawn/native/BlitTextureToBuffer.cpp", |
| 290 |
"src/dawn/native/BlitTextureToBuffer.h", |
| 291 |
"src/dawn/native/Blob.cpp", |
| 292 |
"src/dawn/native/Blob.h", |
| 293 |
"src/dawn/native/BlobCache.cpp", |
| 294 |
"src/dawn/native/BlobCache.h", |
| 295 |
"src/dawn/native/BuddyAllocator.cpp", |
| 296 |
"src/dawn/native/BuddyAllocator.h", |
| 297 |
"src/dawn/native/BuddyMemoryAllocator.cpp", |
| 298 |
"src/dawn/native/BuddyMemoryAllocator.h", |
| 299 |
"src/dawn/native/Buffer.cpp", |
| 300 |
"src/dawn/native/Buffer.h", |
| 301 |
"src/dawn/native/CacheKey.cpp", |
| 302 |
"src/dawn/native/CacheKey.h", |
| 303 |
"src/dawn/native/CacheRequest.cpp", |
| 304 |
"src/dawn/native/CacheRequest.h", |
| 305 |
"src/dawn/native/CacheResult.h", |
| 306 |
"src/dawn/native/CachedObject.cpp", |
| 307 |
"src/dawn/native/CachedObject.h", |
| 308 |
"src/dawn/native/CallbackTaskManager.cpp", |
| 309 |
"src/dawn/native/CallbackTaskManager.h", |
| 310 |
"src/dawn/native/ChainUtils.h", |
| 311 |
"src/dawn/native/ChainUtilsImpl.h", |
| 312 |
"src/dawn/native/CommandAllocator.cpp", |
| 313 |
"src/dawn/native/CommandAllocator.h", |
| 314 |
"src/dawn/native/CommandBuffer.cpp", |
| 315 |
"src/dawn/native/CommandBuffer.h", |
| 316 |
"src/dawn/native/CommandBufferStateTracker.cpp", |
| 317 |
"src/dawn/native/CommandBufferStateTracker.h", |
| 318 |
"src/dawn/native/CommandEncoder.cpp", |
| 319 |
"src/dawn/native/CommandEncoder.h", |
| 320 |
"src/dawn/native/CommandValidation.cpp", |
| 321 |
"src/dawn/native/CommandValidation.h", |
| 322 |
"src/dawn/native/Commands.cpp", |
| 323 |
"src/dawn/native/Commands.h", |
| 324 |
"src/dawn/native/CompilationMessages.cpp", |
| 325 |
"src/dawn/native/CompilationMessages.h", |
| 326 |
"src/dawn/native/ComputePassEncoder.cpp", |
| 327 |
"src/dawn/native/ComputePassEncoder.h", |
| 328 |
"src/dawn/native/ComputePipeline.cpp", |
| 329 |
"src/dawn/native/ComputePipeline.h", |
| 330 |
"src/dawn/native/CopyTextureForBrowserHelper.cpp", |
| 331 |
"src/dawn/native/CopyTextureForBrowserHelper.h", |
| 332 |
"src/dawn/native/CreatePipelineAsyncTask.cpp", |
| 333 |
"src/dawn/native/CreatePipelineAsyncTask.h", |
| 334 |
"src/dawn/native/Device.cpp", |
| 335 |
"src/dawn/native/Device.h", |
| 336 |
"src/dawn/native/DynamicUploader.cpp", |
| 337 |
"src/dawn/native/DynamicUploader.h", |
| 338 |
"src/dawn/native/EncodingContext.cpp", |
| 339 |
"src/dawn/native/EncodingContext.h", |
| 340 |
"src/dawn/native/EnumClassBitmasks.h", |
| 341 |
"src/dawn/native/EnumMaskIterator.h", |
| 342 |
"src/dawn/native/Error.cpp", |
| 343 |
"src/dawn/native/Error.h", |
| 344 |
"src/dawn/native/ErrorData.cpp", |
| 345 |
"src/dawn/native/ErrorData.h", |
| 346 |
"src/dawn/native/ErrorInjector.cpp", |
| 347 |
"src/dawn/native/ErrorInjector.h", |
| 348 |
"src/dawn/native/ErrorScope.cpp", |
| 349 |
"src/dawn/native/ErrorScope.h", |
| 350 |
"src/dawn/native/ExecutionQueue.cpp", |
| 351 |
"src/dawn/native/ExecutionQueue.h", |
| 352 |
"src/dawn/native/ExternalTexture.cpp", |
| 353 |
"src/dawn/native/ExternalTexture.h", |
| 354 |
"src/dawn/native/Features.cpp", |
| 355 |
"src/dawn/native/Features.h", |
| 356 |
"src/dawn/native/Format.cpp", |
| 357 |
"src/dawn/native/Format.h", |
| 358 |
"src/dawn/native/Forward.h", |
| 359 |
"src/dawn/native/IndirectDrawMetadata.cpp", |
| 360 |
"src/dawn/native/IndirectDrawMetadata.h", |
| 361 |
"src/dawn/native/IndirectDrawValidationEncoder.cpp", |
| 362 |
"src/dawn/native/IndirectDrawValidationEncoder.h", |
| 363 |
"src/dawn/native/Instance.cpp", |
| 364 |
"src/dawn/native/Instance.h", |
| 365 |
"src/dawn/native/IntegerTypes.h", |
| 366 |
"src/dawn/native/InternalPipelineStore.cpp", |
| 367 |
"src/dawn/native/InternalPipelineStore.h", |
| 368 |
"src/dawn/native/Limits.cpp", |
| 369 |
"src/dawn/native/Limits.h", |
| 370 |
"src/dawn/native/ObjectBase.cpp", |
| 371 |
"src/dawn/native/ObjectBase.h", |
| 372 |
"src/dawn/native/ObjectContentHasher.cpp", |
| 373 |
"src/dawn/native/ObjectContentHasher.h", |
| 374 |
"src/dawn/native/PassResourceUsage.cpp", |
| 375 |
"src/dawn/native/PassResourceUsage.h", |
| 376 |
"src/dawn/native/PassResourceUsageTracker.cpp", |
| 377 |
"src/dawn/native/PassResourceUsageTracker.h", |
| 378 |
"src/dawn/native/PerStage.cpp", |
| 379 |
"src/dawn/native/PerStage.h", |
| 380 |
"src/dawn/native/PhysicalDevice.cpp", |
| 381 |
"src/dawn/native/PhysicalDevice.h", |
| 382 |
"src/dawn/native/Pipeline.cpp", |
| 383 |
"src/dawn/native/Pipeline.h", |
| 384 |
"src/dawn/native/PipelineCache.cpp", |
| 385 |
"src/dawn/native/PipelineCache.h", |
| 386 |
"src/dawn/native/PipelineLayout.cpp", |
| 387 |
"src/dawn/native/PipelineLayout.h", |
| 388 |
"src/dawn/native/PooledResourceMemoryAllocator.cpp", |
| 389 |
"src/dawn/native/PooledResourceMemoryAllocator.h", |
| 390 |
"src/dawn/native/ProgrammableEncoder.cpp", |
| 391 |
"src/dawn/native/ProgrammableEncoder.h", |
| 392 |
"src/dawn/native/QueryHelper.cpp", |
| 393 |
"src/dawn/native/QueryHelper.h", |
| 394 |
"src/dawn/native/QuerySet.cpp", |
| 395 |
"src/dawn/native/QuerySet.h", |
| 396 |
"src/dawn/native/Queue.cpp", |
| 397 |
"src/dawn/native/Queue.h", |
| 398 |
"src/dawn/native/RefCountedWithExternalCount.cpp", |
| 399 |
"src/dawn/native/RefCountedWithExternalCount.h", |
| 400 |
"src/dawn/native/RenderBundle.cpp", |
| 401 |
"src/dawn/native/RenderBundle.h", |
| 402 |
"src/dawn/native/RenderBundleEncoder.cpp", |
| 403 |
"src/dawn/native/RenderBundleEncoder.h", |
| 404 |
"src/dawn/native/RenderEncoderBase.cpp", |
| 405 |
"src/dawn/native/RenderEncoderBase.h", |
| 406 |
"src/dawn/native/RenderPassEncoder.cpp", |
| 407 |
"src/dawn/native/RenderPassEncoder.h", |
| 408 |
"src/dawn/native/RenderPipeline.cpp", |
| 409 |
"src/dawn/native/RenderPipeline.h", |
| 410 |
"src/dawn/native/ResourceHeap.h", |
| 411 |
"src/dawn/native/ResourceHeapAllocator.h", |
| 412 |
"src/dawn/native/ResourceMemoryAllocation.cpp", |
| 413 |
"src/dawn/native/ResourceMemoryAllocation.h", |
| 414 |
"src/dawn/native/RingBufferAllocator.cpp", |
| 415 |
"src/dawn/native/RingBufferAllocator.h", |
| 416 |
"src/dawn/native/Sampler.cpp", |
| 417 |
"src/dawn/native/Sampler.h", |
| 418 |
"src/dawn/native/ScratchBuffer.cpp", |
| 419 |
"src/dawn/native/ScratchBuffer.h", |
| 420 |
"src/dawn/native/Serializable.h", |
| 421 |
"src/dawn/native/ShaderModule.cpp", |
| 422 |
"src/dawn/native/ShaderModule.h", |
| 423 |
"src/dawn/native/SharedFence.cpp", |
| 424 |
"src/dawn/native/SharedFence.h", |
| 425 |
"src/dawn/native/SharedTextureMemory.cpp", |
| 426 |
"src/dawn/native/SharedTextureMemory.h", |
| 427 |
"src/dawn/native/StreamImplTint.cpp", |
| 428 |
"src/dawn/native/Subresource.cpp", |
| 429 |
"src/dawn/native/Subresource.h", |
| 430 |
"src/dawn/native/SubresourceStorage.h", |
| 431 |
"src/dawn/native/Surface.cpp", |
| 432 |
"src/dawn/native/Surface.h", |
| 433 |
"src/dawn/native/SwapChain.cpp", |
| 434 |
"src/dawn/native/SwapChain.h", |
| 435 |
"src/dawn/native/Texture.cpp", |
| 436 |
"src/dawn/native/Texture.h", |
| 437 |
"src/dawn/native/TintUtils.cpp", |
| 438 |
"src/dawn/native/TintUtils.h", |
| 439 |
"src/dawn/native/ToBackend.h", |
| 440 |
"src/dawn/native/Toggles.cpp", |
| 441 |
"src/dawn/native/Toggles.h", |
| 442 |
"src/dawn/native/UsageValidationMode.h", |
| 443 |
"src/dawn/native/VertexFormat.cpp", |
| 444 |
"src/dawn/native/VertexFormat.h", |
| 445 |
"src/dawn/native/VisitableMembers.h", |
| 446 |
"src/dawn/native/dawn_platform.h", |
| 447 |
"src/dawn/native/stream/BlobSource.cpp", |
| 448 |
"src/dawn/native/stream/BlobSource.h", |
| 449 |
"src/dawn/native/stream/ByteVectorSink.cpp", |
| 450 |
"src/dawn/native/stream/ByteVectorSink.h", |
| 451 |
"src/dawn/native/stream/Sink.h", |
| 452 |
"src/dawn/native/stream/Source.h", |
| 453 |
"src/dawn/native/stream/Stream.cpp", |
| 454 |
"src/dawn/native/stream/Stream.h", |
| 455 |
"src/dawn/native/utils/WGPUHelpers.cpp", |
| 456 |
"src/dawn/native/utils/WGPUHelpers.h", |
| 457 |
"src/dawn/native/webgpu_absl_format.cpp", |
| 458 |
"src/dawn/native/webgpu_absl_format.h", |
| 459 |
# From dawn/src/dawn/native/BUILD.gn:utils_gen |
| 460 |
"src/dawn/native/ChainUtils_autogen.cpp", |
| 461 |
"src/dawn/native/ChainUtils_autogen.h", |
| 462 |
"src/dawn/native/Features_autogen.h", |
| 463 |
"src/dawn/native/Features_autogen.inl", |
| 464 |
"src/dawn/native/ObjectType_autogen.cpp", |
| 465 |
"src/dawn/native/ObjectType_autogen.h", |
| 466 |
"src/dawn/native/ProcTable.cpp", |
| 467 |
"src/dawn/native/ValidationUtils_autogen.cpp", |
| 468 |
"src/dawn/native/ValidationUtils_autogen.h", |
| 469 |
"src/dawn/native/dawn_platform_autogen.h", |
| 470 |
"src/dawn/native/webgpu_StreamImpl_autogen.cpp", |
| 471 |
"src/dawn/native/webgpu_absl_format_autogen.cpp", |
| 472 |
"src/dawn/native/webgpu_absl_format_autogen.h", |
| 473 |
"src/dawn/native/wgpu_structs_autogen.cpp", |
| 474 |
"src/dawn/native/wgpu_structs_autogen.h", |
| 475 |
# From dawn/src/dawn/common/BUILD.gn:common |
| 476 |
"src/dawn/common/Alloc.h", |
| 477 |
"src/dawn/common/Assert.cpp", |
| 478 |
"src/dawn/common/Assert.h", |
| 479 |
"src/dawn/common/BitSetIterator.h", |
| 480 |
"src/dawn/common/Compiler.h", |
| 481 |
"src/dawn/common/ConcurrentCache.h", |
| 482 |
"src/dawn/common/Constants.h", |
| 483 |
"src/dawn/common/ContentLessObjectCache.h", |
| 484 |
"src/dawn/common/ContentLessObjectCacheable.h", |
| 485 |
"src/dawn/common/CoreFoundationRef.h", |
| 486 |
"src/dawn/common/DynamicLib.cpp", |
| 487 |
"src/dawn/common/DynamicLib.h", |
| 488 |
"src/dawn/common/GPUInfo.cpp", |
| 489 |
"src/dawn/common/GPUInfo.h", |
| 490 |
"src/dawn/common/HashUtils.h", |
| 491 |
"src/dawn/common/IOKitRef.h", |
| 492 |
"src/dawn/common/LinkedList.h", |
| 493 |
"src/dawn/common/Log.cpp", |
| 494 |
"src/dawn/common/Log.h", |
| 495 |
"src/dawn/common/Math.cpp", |
| 496 |
"src/dawn/common/Math.h", |
| 497 |
"src/dawn/common/Mutex.cpp", |
| 498 |
"src/dawn/common/Mutex.h", |
| 499 |
"src/dawn/common/MutexProtected.h", |
| 500 |
"src/dawn/common/NSRef.h", |
| 501 |
"src/dawn/common/NonCopyable.h", |
| 502 |
"src/dawn/common/Numeric.h", |
| 503 |
"src/dawn/common/PlacementAllocated.h", |
| 504 |
"src/dawn/common/Platform.h", |
| 505 |
"src/dawn/common/Preprocessor.h", |
| 506 |
"src/dawn/common/Ref.h", |
| 507 |
"src/dawn/common/RefBase.h", |
| 508 |
"src/dawn/common/RefCounted.cpp", |
| 509 |
"src/dawn/common/RefCounted.h", |
| 510 |
"src/dawn/common/Result.cpp", |
| 511 |
"src/dawn/common/Result.h", |
| 512 |
"src/dawn/common/SerialMap.h", |
| 513 |
"src/dawn/common/SerialQueue.h", |
| 514 |
"src/dawn/common/SerialStorage.h", |
| 515 |
"src/dawn/common/SlabAllocator.cpp", |
| 516 |
"src/dawn/common/SlabAllocator.h", |
| 517 |
"src/dawn/common/StackContainer.h", |
| 518 |
"src/dawn/common/SystemUtils.cpp", |
| 519 |
"src/dawn/common/SystemUtils.h", |
| 520 |
"src/dawn/common/TypeTraits.h", |
| 521 |
"src/dawn/common/TypedInteger.h", |
| 522 |
"src/dawn/common/UnderlyingType.h", |
| 523 |
"src/dawn/common/WeakRef.h", |
| 524 |
"src/dawn/common/WeakRefSupport.cpp", |
| 525 |
"src/dawn/common/WeakRefSupport.h", |
| 526 |
"src/dawn/common/ityp_array.h", |
| 527 |
"src/dawn/common/ityp_bitset.h", |
| 528 |
"src/dawn/common/ityp_span.h", |
| 529 |
"src/dawn/common/ityp_stack_vec.h", |
| 530 |
"src/dawn/common/ityp_vector.h", |
| 531 |
"src/dawn/common/vulkan_platform.h", |
| 532 |
"src/dawn/common/xlib_with_undefs.h", |
| 533 |
# Generated files in dawn/src/dawn/common/BUILD.gn |
| 534 |
"src/dawn/common/GPUInfo_autogen.cpp", |
| 535 |
"src/dawn/common/GPUInfo_autogen.h", |
| 536 |
"src/dawn/common/Version_autogen.h", |
| 537 |
# From dawn/src/dawn/platform/BUILD.gn:platform |
| 538 |
"include/dawn/platform/DawnPlatform.h", |
| 539 |
"include/dawn/platform/dawn_platform_export.h", |
| 540 |
"src/dawn/platform/DawnPlatform.cpp", |
| 541 |
"src/dawn/platform/WorkerThread.cpp", |
| 542 |
"src/dawn/platform/WorkerThread.h", |
| 543 |
"src/dawn/platform/metrics/HistogramMacros.cpp", |
| 544 |
"src/dawn/platform/metrics/HistogramMacros.h", |
| 545 |
"src/dawn/platform/tracing/EventTracer.cpp", |
| 546 |
"src/dawn/platform/tracing/EventTracer.h", |
| 547 |
"src/dawn/platform/tracing/TraceEvent.h", |
| 548 |
] |
| 549 |
|
| 550 |
DAWN_VULKAN_SRCS = [ |
| 551 |
# From dawn/src/dawn/native/BUILD.gn:sources (dawn_enable_vulkan) |
| 552 |
"src/dawn/native/SpirvValidation.cpp", |
| 553 |
"src/dawn/native/SpirvValidation.h", |
| 554 |
"src/dawn/native/vulkan/BackendVk.cpp", |
| 555 |
"src/dawn/native/vulkan/BackendVk.h", |
| 556 |
"src/dawn/native/vulkan/BindGroupLayoutVk.cpp", |
| 557 |
"src/dawn/native/vulkan/BindGroupLayoutVk.h", |
| 558 |
"src/dawn/native/vulkan/BindGroupVk.cpp", |
| 559 |
"src/dawn/native/vulkan/BindGroupVk.h", |
| 560 |
"src/dawn/native/vulkan/BufferVk.cpp", |
| 561 |
"src/dawn/native/vulkan/BufferVk.h", |
| 562 |
"src/dawn/native/vulkan/StreamImplVk.cpp", |
| 563 |
"src/dawn/native/vulkan/CommandBufferVk.cpp", |
| 564 |
"src/dawn/native/vulkan/CommandBufferVk.h", |
| 565 |
"src/dawn/native/vulkan/CommandRecordingContext.h", |
| 566 |
"src/dawn/native/vulkan/ComputePipelineVk.cpp", |
| 567 |
"src/dawn/native/vulkan/ComputePipelineVk.h", |
| 568 |
"src/dawn/native/vulkan/DescriptorSetAllocation.h", |
| 569 |
"src/dawn/native/vulkan/DescriptorSetAllocator.cpp", |
| 570 |
"src/dawn/native/vulkan/DescriptorSetAllocator.h", |
| 571 |
"src/dawn/native/vulkan/DeviceVk.cpp", |
| 572 |
"src/dawn/native/vulkan/DeviceVk.h", |
| 573 |
"src/dawn/native/vulkan/ExternalHandle.h", |
| 574 |
"src/dawn/native/vulkan/FencedDeleter.cpp", |
| 575 |
"src/dawn/native/vulkan/FencedDeleter.h", |
| 576 |
"src/dawn/native/vulkan/Forward.h", |
| 577 |
"src/dawn/native/vulkan/PhysicalDeviceVk.cpp", |
| 578 |
"src/dawn/native/vulkan/PhysicalDeviceVk.h", |
| 579 |
"src/dawn/native/vulkan/PipelineCacheVk.cpp", |
| 580 |
"src/dawn/native/vulkan/PipelineCacheVk.h", |
| 581 |
"src/dawn/native/vulkan/PipelineLayoutVk.cpp", |
| 582 |
"src/dawn/native/vulkan/PipelineLayoutVk.h", |
| 583 |
"src/dawn/native/vulkan/QuerySetVk.cpp", |
| 584 |
"src/dawn/native/vulkan/QuerySetVk.h", |
| 585 |
"src/dawn/native/vulkan/QueueVk.cpp", |
| 586 |
"src/dawn/native/vulkan/QueueVk.h", |
| 587 |
"src/dawn/native/vulkan/RenderPassCache.cpp", |
| 588 |
"src/dawn/native/vulkan/RenderPassCache.h", |
| 589 |
"src/dawn/native/vulkan/RenderPipelineVk.cpp", |
| 590 |
"src/dawn/native/vulkan/RenderPipelineVk.h", |
| 591 |
"src/dawn/native/vulkan/ResourceHeapVk.cpp", |
| 592 |
"src/dawn/native/vulkan/ResourceHeapVk.h", |
| 593 |
"src/dawn/native/vulkan/ResourceMemoryAllocatorVk.cpp", |
| 594 |
"src/dawn/native/vulkan/ResourceMemoryAllocatorVk.h", |
| 595 |
"src/dawn/native/vulkan/SamplerVk.cpp", |
| 596 |
"src/dawn/native/vulkan/SamplerVk.h", |
| 597 |
"src/dawn/native/vulkan/ShaderModuleVk.cpp", |
| 598 |
"src/dawn/native/vulkan/ShaderModuleVk.h", |
| 599 |
"src/dawn/native/vulkan/SwapChainVk.cpp", |
| 600 |
"src/dawn/native/vulkan/SwapChainVk.h", |
| 601 |
"src/dawn/native/vulkan/TextureVk.cpp", |
| 602 |
"src/dawn/native/vulkan/TextureVk.h", |
| 603 |
"src/dawn/native/vulkan/UtilsVulkan.cpp", |
| 604 |
"src/dawn/native/vulkan/UtilsVulkan.h", |
| 605 |
"src/dawn/native/vulkan/VulkanBackend.cpp", |
| 606 |
"src/dawn/native/vulkan/VulkanError.cpp", |
| 607 |
"src/dawn/native/vulkan/VulkanError.h", |
| 608 |
"src/dawn/native/vulkan/VulkanExtensions.cpp", |
| 609 |
"src/dawn/native/vulkan/VulkanExtensions.h", |
| 610 |
"src/dawn/native/vulkan/VulkanFunctions.cpp", |
| 611 |
"src/dawn/native/vulkan/VulkanFunctions.h", |
| 612 |
"src/dawn/native/vulkan/VulkanInfo.cpp", |
| 613 |
"src/dawn/native/vulkan/VulkanInfo.h", |
| 614 |
"src/dawn/native/vulkan/external_memory/MemoryImportParams.h", |
| 615 |
"src/dawn/native/vulkan/external_memory/MemoryService.cpp", |
| 616 |
"src/dawn/native/vulkan/external_memory/MemoryService.h", |
| 617 |
"src/dawn/native/vulkan/external_memory/MemoryServiceImplementation.cpp", |
| 618 |
"src/dawn/native/vulkan/external_memory/MemoryServiceImplementation.h", |
| 619 |
"src/dawn/native/vulkan/external_semaphore/SemaphoreService.cpp", |
| 620 |
"src/dawn/native/vulkan/external_semaphore/SemaphoreService.h", |
| 621 |
"src/dawn/native/vulkan/external_semaphore/SemaphoreServiceImplementation.cpp", |
| 622 |
"src/dawn/native/vulkan/external_semaphore/SemaphoreServiceImplementation.h", |
| 623 |
] |
| 624 |
|
| 625 |
DAWN_VULKAN_LINUX_SRCS = [ |
| 626 |
# From dawn/src/dawn/native/BUILD.gn:sources (dawn_enable_vulkan && (is_android || is_linux || is_chromeos)) |
| 627 |
"src/dawn/native/vulkan/external_semaphore/SemaphoreServiceImplementationFD.cpp", |
| 628 |
"src/dawn/native/vulkan/external_semaphore/SemaphoreServiceImplementationFD.h", |
| 629 |
# From dawn/src/dawn/native/BUILD.gn:sources (dawn_enable_vulkan && (is_linux || is_chromeos)) |
| 630 |
"src/dawn/native/vulkan/external_memory/MemoryServiceImplementationDmaBuf.cpp", |
| 631 |
"src/dawn/native/vulkan/external_memory/MemoryServiceImplementationDmaBuf.h", |
| 632 |
"src/dawn/native/vulkan/external_memory/MemoryServiceImplementationOpaqueFD.cpp", |
| 633 |
"src/dawn/native/vulkan/external_memory/MemoryServiceImplementationOpaqueFD.h", |
| 634 |
] |
| 635 |
|
| 636 |
DAWN_VULKAN_DEFINES = [ |
| 637 |
# From dawn/src/dawn/common/BUILD.gn:internal_config |
| 638 |
"DAWN_ENABLE_BACKEND_VULKAN", |
| 639 |
] |
| 640 |
|
| 641 |
cc_library( |
| 642 |
name = "dawn_native", |
| 643 |
srcs = DAWN_SRCS + DAWN_VULKAN_SRCS + DAWN_VULKAN_LINUX_SRCS, |
| 644 |
hdrs = DAWN_HDRS, |
| 645 |
copts = [ |
| 646 |
# List this as a copt, so as not to propagate it to dependents |
| 647 |
# Skia has its own vulkan headers and we do not want these to |
| 648 |
# interfere/override those. |
| 649 |
"-Iexternal/vulkan_headers/include", |
| 650 |
], |
| 651 |
defines = DAWN_VULKAN_DEFINES, |
| 652 |
includes = [ |
| 653 |
"include", |
| 654 |
"src", |
| 655 |
], |
| 656 |
visibility = ["//visibility:private"], # only used by :dawn |
| 657 |
deps = [ |
| 658 |
# Dawn specifically depends on dawn/src/tint:libtint |
| 659 |
":tint", |
| 660 |
"@abseil_cpp//absl/strings:str_format", |
| 661 |
"@vulkan_headers", |
| 662 |
"@vulkan_tools", |
| 663 |
"@vulkan_utility_libraries", |
| 664 |
], |
| 665 |
) |
| 666 |
|
| 667 |
cc_library( |
| 668 |
name = "dawn_cpp", |
| 669 |
srcs = [ |
| 670 |
# From dawn/src/dawn/BUILD.gn#cpp |
| 671 |
"include/dawn/webgpu.h", |
| 672 |
"include/dawn/EnumClassBitmasks.h", |
| 673 |
"include/dawn/webgpu_cpp.h", |
| 674 |
"include/dawn/webgpu_cpp_chained_struct.h", |
| 675 |
"src/dawn/webgpu_cpp.cpp", |
| 676 |
], |
| 677 |
includes = [ |
| 678 |
"include", |
| 679 |
], |
| 680 |
visibility = ["//visibility:private"], # only used by :dawn |
| 681 |
) |
| 682 |
|
| 683 |
cc_library( |
| 684 |
name = "dawn_proc", |
| 685 |
srcs = [ |
| 686 |
# From dawn/src/dawn/BUILD.gn#proc |
| 687 |
"include/dawn/webgpu.h", |
| 688 |
"include/dawn/dawn_proc.h", |
| 689 |
"include/dawn/dawn_thread_dispatch_proc.h", |
| 690 |
"include/dawn/dawn_proc_table.h", |
| 691 |
"src/dawn/dawn_proc.c", |
| 692 |
"src/dawn/dawn_thread_dispatch_proc.cpp", |
| 693 |
], |
| 694 |
includes = [ |
| 695 |
"include", |
| 696 |
], |
| 697 |
visibility = ["//visibility:private"], # only used by :dawn |
| 698 |
) |
| 699 |
|
| 700 |
cc_library( |
| 701 |
name = "dawn", |
| 702 |
visibility = ["//visibility:public"], |
| 703 |
deps = [ |
| 704 |
":dawn_cpp", |
| 705 |
":dawn_native", |
| 706 |
":dawn_proc", |
| 707 |
], |
| 708 |
) |
| 709 |
|
| 710 |
cc_library( |
| 711 |
name = "tint", |
| 712 |
hdrs = glob( |
| 713 |
[ |
| 714 |
"include/**/*.h", |
| 715 |
], |
| 716 |
allow_empty = False, |
| 717 |
), |
| 718 |
defines = [ |
| 719 |
"TINT_BUILD_WGSL_READER=1", |
| 720 |
"TINT_BUILD_WGSL_WRITER=1", |
| 721 |
], |
| 722 |
includes = ["include"], |
| 723 |
visibility = ["//visibility:public"], |
| 724 |
deps = [ |
| 725 |
"@dawn//src/tint/api", |
| 726 |
], |
| 727 |
) |