dawn-cmake/generator
Loko Kung 2e1b359087 Add wire serialized command buffer padding.
Pads serialized wire command buffers to 8 bytes so that we don't have
misaligned write/reads which can cause SIGILL depending on platform and
compilation mode, i.e. -c dbg in google3 builds.

- Adds helpers for aligning sizeof calls.
- Adds constant for wire padding (8u).
- Modifies BufferConsumer to allocate according to padding. This
  guarantees that when we [de]serialize stuff, the padding should be
  equal on both sides.
- Modifies extra byte serialization code (adding CommandExtension
  struct). This makes it clearer that each extension needs to be
  padded independently. Otherwise, before in wire/client/Buffer.cpp,
  since the read/write handle sizes were being passed as a sum, but
  read out separately from the BufferConsumer, we corrupt our pointers.
- Adds some simple unit tests.

Bug: dawn:1334
Change-Id: Id80e7c01a34b9f01c3f02b3e6c04c3bb3ad0eff9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110501
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-22 23:19:43 +00:00
..
templates Add wire serialized command buffer padding. 2022-11-22 23:19:43 +00:00
CMakeLists.txt CMake: tweak third-party imports. 2022-05-16 09:11:21 +00:00
dawn_generator.gni BUILD.gn: Make toolchain.ninja not contain system absolute paths. 2022-11-22 11:07:27 +00:00
dawn_gpu_info_generator.py Make adapter info device matching more flexible 2022-08-02 22:14:35 +00:00
dawn_json_generator.py Rename CacheKey-related files to Stream 2022-07-29 00:36:21 +00:00
dawn_version_generator.py Fix incorrect indentation in version generator script. 2022-06-23 01:14:24 +00:00
extract_json.py Avoid unnecessary recompiles with code generators. 2021-03-23 19:06:02 +00:00
generator_lib.gni BUILD.gn: Make toolchain.ninja not contain system absolute paths. 2022-11-22 11:07:27 +00:00
generator_lib.py Delete the remove_stale_autogen_files mechanism. 2022-09-20 17:28:33 +00:00
opengl_loader_generator.py tint->dawn: Move src/dawn_native -> src/dawn/native 2022-02-04 17:07:46 +00:00