Commit 0ded041
Add ExternalTexture MSAA render unit tests (#1712)
## Context
Coverage for MSAA + ExternalTexture rendering. Both tests pass on master
on D3D11 today; this PR characterizes what works so future device-loss /
`updateWrappedNativeTexture` MSAA work has a regression baseline.
## Changes
Two new gtest cases in `Tests.ExternalTexture.Msaa.cpp` that drive a
JS-side `RenderTargetTexture` whose `colorAttachment` is a
`wrapNativeTexture` over an MSAA GPU texture, then read back the pixels
(resolving MSAA before staging):
- `RenderWithMsaaSamples1` -- discriminator, asserts zero blend pixels
along the rotated red-plane edges so the samples=4 case is diagnostic.
- `RenderWithMsaaSamples4` -- asserts red/white blend pixels along the
same edges.
Cross-platform per the convention #1646 establishes: file lives in
shared `SOURCES`, gated by `SKIP_EXTERNAL_TEXTURE_TESTS` /
`SKIP_RENDER_TESTS`. CMake defines `SKIP_RENDER_TESTS` for D3D12 (no
impl).
Renames `Utils.{h,cpp,mm}` -> `Helpers.{h,cpp,mm}` under `namespace
Helpers`. Collapses `CreateTestTexture` and the new MSAA-RT helper into
one `Helpers::CreateTexture(d, w, h, arraySize=1, renderTarget=false,
samples=1)`. Adds `Helpers::ReadPixels` taking `PlatformInfo` so the
Metal path can use bgfx's command queue (avoids cross-queue sync).
Implemented on D3D11 and Metal; D3D12 / OpenGL throw (test skipped on
those configurations).
Will conflict with #1646 on `Helpers.h` / `Helpers.D3D11.cpp` /
`CMakeLists.txt` -- whichever lands first picks a winner.
[Created by Copilot on behalf of @bghgary]
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a400a90 commit 0ded041
19 files changed
Lines changed: 1206 additions & 126 deletions
File tree
- Apps/UnitTests
- JavaScript
- dist
- src
- Source
- Install/Test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
30 | | - | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
0 commit comments