D3D12: Fix 64-bit overflow for large buffers and return OOM.

Use `resourceDesc.alignment` + GetResourceAllocationInfo
 to determine the buffer size and OOM should it return an
empty sized buffer instead of overflowing + INVALID_ARGS.

BUG=dawn:238

Change-Id: I0a2cc7dac629d55624dafa4a3c4a45f16e90049c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14420
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
3 files changed
tree: 7294f44113070354581f31894b25a5f7a3fe64fc
  1. .clang-format
  2. .gitattributes
  3. .gitignore
  4. .gn
  5. AUTHORS
  6. BUILD.gn
  7. CONTRIBUTING.md
  8. DEPS
  9. LICENSE
  10. OWNERS
  11. PRESUBMIT.py
  12. README.chromium
  13. README.md
  14. build_overrides/
  15. codereview.settings
  16. dawn.json
  17. dawn_wire.json
  18. docs/
  19. examples/
  20. generator/
  21. infra/
  22. scripts/
  23. src/
  24. third_party/
README.md

Dawn, a WebGPU implementation

Dawn is an open-source and cross-platform implementation of the work-in-progress WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.

Dawn provides several WebGPU building blocks:

  • WebGPU C/C++ headers that applications and other building blocks use.
    • The webgpu.h version that Dawn implements.
    • A C++ wrapper for the webgpu.h.
  • A “native” implementation of WebGPU using platforms' GPU APIs:
    • D3D12 on Windows 10
    • Metal on macOS and iOS
    • Vulkan on Windows, Linux, ChromeOS, Android and Fuchsia
    • OpenGL as best effort where available
  • A client-server implementation of WebGPU for applications that are in a sandbox without access to native drivers

Helpful links:

Documentation table of content

Developer documentation:

User documentation: (TODO, figure out what overlaps with webgpu.h docs)

Status

(TODO)

License

Apache 2.0 Public License, please see LICENSE.

Disclaimer

This is not an officially supported Google product.