mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-30 10:52:28 +00:00
Compare commits
47
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e0b882691 | ||
|
|
6c52bfb030 | ||
|
|
6059d701e2 | ||
|
|
d0a1c21a4e | ||
|
|
4fde342db1 | ||
|
|
a17edafe3b | ||
|
|
3cd97c3cc0 | ||
|
|
c504eb8fc8 | ||
|
|
0f9a6e1e11 | ||
|
|
e24fa6d42f | ||
|
|
c46611ff9d | ||
|
|
29a5cd70c0 | ||
|
|
15b11b4be8 | ||
|
|
690c756037 | ||
|
|
5c1efdb517 | ||
|
|
413c46545d | ||
|
|
0565e0ac37 | ||
|
|
a74ad2da44 | ||
|
|
fc358d0525 | ||
|
|
e502559470 | ||
|
|
06cd29a9a4 | ||
|
|
b49b0d9696 | ||
|
|
5a53fe1fd5 | ||
|
|
0c8a583378 | ||
|
|
6fbe856b4e | ||
|
|
084714739f | ||
|
|
23f73ee906 | ||
|
|
33a3ec2329 | ||
|
|
84dd9e2df5 | ||
|
|
8d7c3bf66c | ||
|
|
394525b8d0 | ||
|
|
5acabd2f6e | ||
|
|
6957389fef | ||
|
|
147888c125 | ||
|
|
d649610b7b | ||
|
|
7f241ad170 | ||
|
|
97947085bf | ||
|
|
f5aed211b5 | ||
|
|
a1fcd96836 | ||
|
|
26003c37e2 | ||
|
|
05b27f886f | ||
|
|
73cee37ee3 | ||
|
|
5a8aa63835 | ||
|
|
75f2ed8c3c | ||
|
|
b8d709fed0 | ||
|
|
c4ceadc39e | ||
|
|
00782e62e9 |
No files matched your search
@@ -23,13 +23,16 @@ cargo build --locked -p bx-cli && target/debug/bx-cli preflight
|
||||
| An Apple Silicon Mac with CrossOver 26.3+, D3DMetal and `mingw-w64` | Checked on the host |
|
||||
| **The project-authorized target build** | Found and saved by `bx-cli setup --find` |
|
||||
| **The GDK** (headers and compilers, under the project's authorization) | Found and saved by `bx-cli setup --find` |
|
||||
| **The Ghidra results of the target build** (the static-analysis run: `RUN_REPORT.md`, `exports/`, `decompiled/`) covering its executable | Found and saved by `bx-cli setup --find` |
|
||||
| At least 10 GiB of free disk space | Measured |
|
||||
|
||||
**The target build, the GDK and the Ghidra results are a hard requirement.** An agent that lacks even one of them does not work on this repository at all: no code, tests, reviews, merges, issues or documentation.
|
||||
|
||||
**If preflight fails, fix it yourself and run it again.** Your person said "work"; do not hand the setup back to them.
|
||||
|
||||
| `MISSING` line | What you do |
|
||||
| --- | --- |
|
||||
| Target build, GDK | `target/debug/bx-cli setup --find`. It searches the home folder, recognises the GDK by its header and the build by its structure (never by name), and saves both. |
|
||||
| Target build, GDK, Ghidra results | `target/debug/bx-cli setup --find`. It searches the home folder, recognises the GDK by its header, the build by its structure (never by name) and the Ghidra results by their layout and the program they cover, and saves all three. |
|
||||
| `mingw-w64 g++` (also `cmake`, `gh`) | `brew install mingw-w64 cmake gh`. Being told to "work" authorizes installing these three. |
|
||||
| Free disk space | Remove your own scratch: build folders and scratch bottles of worktrees you created. Never another session's files. |
|
||||
|
||||
@@ -37,13 +40,13 @@ cargo build --locked -p bx-cli && target/debug/bx-cli preflight
|
||||
|
||||
- the host is not an Apple Silicon Mac;
|
||||
- CrossOver is not installed (it is licensed software; do not install it);
|
||||
- `setup --find` reports that the target build or the GDK is not on this machine, or found more than one distinct build (which build to use is your person's choice: they run `bx-cli setup --target-exe <path>` once).
|
||||
- `setup --find` reports that the target build, the GDK or the Ghidra results covering the build are not on this machine, or found more than one distinct build (which build to use is your person's choice: they run `bx-cli setup --target-exe <path>` once).
|
||||
|
||||
In those cases do not work around it: no fixes, tests or reviews "for someone else to verify". Work here is found by running the target build and checked against the GDK; an agent without them is guessing.
|
||||
In those cases stop and do not work around it: no fixes, tests, reviews, merges or documentation "for someone else to verify". Work here is found by running the target build, located in the Ghidra results and checked against the GDK; an agent without all three is guessing.
|
||||
|
||||
Also check `git`, `gh` (`gh auth status`; if not logged in, ask the user to run `gh auth login`), `cargo`, `cmake` and `python3`; verify push access or fork (`gh repo fork MacosPorters/betterxen --remote`); sync with `origin/main`. Work in your own worktree and your own bottle; never use a bottle another session is using.
|
||||
|
||||
`bx-cli setup` remembers the two locations in `~/.config/betterxen/local.conf`, outside every checkout, so it happens once per machine and works in every worktree, shell and agent session. (`BX_TARGET_EXE` and `BX_GDK_ROOT` override it for one command.) Never commit those paths, and never put a path, file name, hash or byte from the target build or the GDK into a commit, issue or pull request (Section 6).
|
||||
`bx-cli setup` remembers the three locations in `~/.config/betterxen/local.conf`, outside every checkout, so it happens once per machine and works in every worktree, shell and agent session. (`BX_TARGET_EXE`, `BX_GDK_ROOT` and `BX_GHIDRA_RESULTS` override it for one command.) Never commit those paths, and never put a path, file name, hash or byte from the target build, the GDK or the Ghidra results into a commit, issue or pull request (Section 6).
|
||||
|
||||
### Step 2 — Pick exactly one thing, in this order
|
||||
|
||||
@@ -75,6 +78,19 @@ Take the first that applies.
|
||||
|
||||
### Step 3 — Work one blocker
|
||||
|
||||
**Before touching any problem the game shows you, find out whether someone already has it.** This applies every time: to the blocker you picked, and to every further problem you meet along the way (a failed load, a refused request, an assert, a crash). Search by the log event, stub symbol, error code and the files you would change:
|
||||
|
||||
```sh
|
||||
gh pr list --repo MacosPorters/betterxen --state open --search "<event, symbol or file>" --json number,title,headRefName
|
||||
gh pr list --repo MacosPorters/betterxen --state merged --search "<event, symbol or file>" --limit 10 --json number,title,mergedAt
|
||||
gh issue list --repo MacosPorters/betterxen --state open --search "<event, symbol or file>" --json number,title,labels
|
||||
```
|
||||
|
||||
- **An open pull request covers it:** check out that branch (`gh pr checkout <n>`), run the build with it, and work there: report what you saw on the pull request, and push a fix to its branch or request changes. Do not write a second fix.
|
||||
- **A merged pull request covers it:** sync with `origin/main` and run again before investigating.
|
||||
- **An issue covers it:** take it up from the issue's notes, and link it from your pull request.
|
||||
- **Nothing covers it:** carry on with step 1 below.
|
||||
|
||||
1. **Claim with a draft pull request, before writing the fix.** Branch `track-<a..f>/<slug>` from `origin/main`, push it with an empty commit or the first small change, and open a **draft** pull request titled `[<Stage>] <signature>`. Before opening it, list open pull requests once more; if one now covers the signature, take the next signature instead. A draft with no push for 3 days may be taken over; say so on it.
|
||||
2. **Evidence before code:** find what the build asked for and what it got, from the run report and the diagnostics. Check the contract against the GDK where the GDK covers it.
|
||||
3. **Smallest fix:** only what removes this blocker. Stay inside the track directories it needs (Section 2); a new cross-DLL export goes through an `[ABI]` pull request first.
|
||||
@@ -99,6 +115,7 @@ Take the first that applies.
|
||||
- `tests/conformance/` — Clean-room synthetic x86-64 PE32+ test binaries (auto-discovered via `test_*/CMakeLists.txt`).
|
||||
- **Retired native-first code:** The earlier native-first workspace was retired from `main` per ADR 0006 and remains preserved permanently at Git tag `native-first-final`. Do not open native-only issues; if hybrid work requires an independent component (such as RDNA 2 decoding), file a focused track issue.
|
||||
- **No unverified compatibility assumptions:** This is an active engineering foundation, not a verified Xbox game compatibility stack. Do not assume CrossOver, Rosetta 2, or D3DMetal provide Xbox runtime behavior without measurement.
|
||||
- **GDK texture libraries (ADR 0010):** Console texture layouts (tiling) and BCPack decompression come from the GDK's own PC libraries, `xg_xs.dll` and `BCPack.dll`, which `bx-cli run` stages for the target build from the configured GDK. Do not reimplement them, and never commit or ship them.
|
||||
|
||||
---
|
||||
|
||||
@@ -156,7 +173,7 @@ _Reserved — policy migration in progress._
|
||||
|
||||
## 7. Claiming, Git Safety & Changelog
|
||||
|
||||
1. **Check before coding (claims):** A blocker is claimed by an open draft pull request titled with its signature (Section 0, Step 3); check open pull requests before opening yours. A draft with no push for 3 days may be taken over. Direct maintainer-assigned tasks do not require a prior issue claim, but still check open issues and PRs first and never take over another contributor's active claim.
|
||||
1. **Check before coding (claims):** A blocker is claimed by an open draft pull request titled with its signature (Section 0, Step 3); check open pull requests before opening yours. Every problem met while running the game, not only the one picked, is searched for in open and merged pull requests and open issues before it is investigated; when a pull request covers it, check that branch out and work there (Section 0, Step 3). A draft with no push for 3 days may be taken over. Direct maintainer-assigned tasks do not require a prior issue claim, but still check open issues and PRs first and never take over another contributor's active claim.
|
||||
2. **Isolate with branches or worktrees:**
|
||||
```sh
|
||||
git worktree add ../wt-<slug> -b track-<a..f>/<slug> origin/main
|
||||
|
||||
+28
-1
@@ -10,6 +10,8 @@ Guest execution uses original, purpose-built test programs. Commercial Xbox game
|
||||
remains unsupported.
|
||||
|
||||
### Changed
|
||||
- **Check for existing work before investigating any problem the game shows** (AGENTS.md Section 0 Step 3 and Section 7, `docs/process/working-method.md`). Every problem met while running the game, not only the picked blocker, is searched for in open and merged pull requests and open issues by its log event, stub symbol, error code and files. An open pull request that covers it is checked out and worked on, never duplicated. Prompted by a duplicate fix for physical-page DirectStorage requests made alongside #707.
|
||||
- **The Ghidra results of the target build are required to work on the repository**, like the target build and the GDK (AGENTS.md Section 0, `docs/process/working-method.md`). An agent that lacks any of the three does not work on the repository. `bx-cli preflight` adds a `Ghidra results` row: present, and covering the configured target build's executable. `bx-cli setup --ghidra-results <dir>` saves them, and `setup --find` finds them by layout (`RUN_REPORT.md`, `decompiled/`, `exports/*/manifest.json` naming the program, `functions.csv`). `BX_GHIDRA_RESULTS` overrides the setting for one command. Unit tests cover an unset setting, a folder that isn't a results folder, results for another program, and results covering the target.
|
||||
- **Roadmap, Picture stage: BetterXen writes its own shader translator** (repository owner's decision, 2026-11-29). The step that said to vendor the upstream GFX10-to-DXIL translator now describes a translator of our own in `shader-transpiler/`: one rule per instruction, control flow as numbered blocks, each rule checked against the console compiler.
|
||||
- **A collaborator only has to say "work"** (AGENTS.md §0, step 1). When `bx-cli preflight` fails, the agent makes the machine ready itself: the new `bx-cli setup --find` searches the home folder, recognises the GDK by its header and the target build by its structure (a large PE32+ file that imports `d3d12_xs.dll`; never by name), ignores the GDK's own tools, treats byte-identical copies as one build and keeps the copy with its imported DLLs beside it, and saves both settings. The agent may install `mingw-w64`, `cmake` and `gh` with Homebrew and free disk space by removing its own scratch. It stops only for what it cannot supply: no Apple Silicon Mac, no CrossOver, the build or the GDK not on the machine, or more than one distinct build.
|
||||
- **Working rules: the pull request is the unit of work, and the target build and the GDK are required** (AGENTS.md §0, [working method](docs/process/working-method.md)). An agent told to "work" first runs the new `bx-cli preflight`, which fails unless the host is an Apple Silicon Mac with CrossOver, D3DMetal and `mingw-w64`, the target build's executable and the GDK folder are known, and 10 GiB of disk is free. A collaborator records the two locations once with the new `bx-cli setup --target-exe <path> --gdk-root <folder>`, which checks them and keeps them in `~/.config/betterxen/local.conf`, outside the repository (`BX_TARGET_EXE` and `BX_GDK_ROOT` override it). If preflight fails the agent stops and does no work. A blocker the agent can fix no longer gets an issue: it is claimed by a draft pull request titled with its run-report signature. Issues are kept for handoffs (label `handoff`), decisions for a person, and the ladder status. Claims by comment and the 7-day stale window are gone; an idle draft may be taken over after 3 days.
|
||||
@@ -27,6 +29,17 @@ remains unsupported.
|
||||
- `dxbc-accc` no longer classifies `DXIL` chunks whose bitcode payload starts with the `NOBC` header-only placeholder as executable DXIL (Track D prerequisite from ADR 0008 / `docs/roadmap.md`). `inspect_dxbc` and `bx_shader_inspect` still report the container's `dxil_chunk_size`, stage, and shader model, but leave `kind` as `Unknown` (or `AcccOnly` when paired with an `ACCC` chunk) instead of `Dxil` or `DualDxilAndAccc`, and `bx_shader_prepare_for_d3dmetal` returns `BX_SHADER_ERR_UNSUPPORTED` rather than passing a bitcode-less container through. Covered by synthetic `NOBC`, mixed-chunk, and bounds-safety unit tests in `dxbc-accc`; live CrossOver execution is unchanged.
|
||||
|
||||
### Added
|
||||
- **Unattended runs get past input screens and continuable asserts** (`docs/testing/target-build-review.md`, Diagnostics).
|
||||
- **`GameInput.dll`:** `BX_INPUT_SCRIPT=A@40,DOWN@50.5,...` presses gamepad buttons at given seconds after the first reading, each for 300 ms, without window focus. Each press, and each entry it cannot read, is logged (`input_script`).
|
||||
- **`bx_runtime_veh.dll`:** `BX_CONTINUE_ASSERTS=1` steps over an `int3` in the title's own executable instead of letting it reach the crash reporter, and logs each address once (`assert_continued`). An `int3` anywhere else is left alone.
|
||||
- **Tests:** `test_gameinput_script` (readings at fixed times carry exactly the scripted buttons, and unreadable entries are skipped) and `test_veh_continue_asserts` (the executable's `int3` is stepped over twice; one outside any module is not). Both fail on `main`'s shims and pass twice with these.
|
||||
- **The GDK's texture libraries at run time (ADR 0010).** Console texture layouts and BCPack come from the GDK's own PC libraries instead of being reimplemented.
|
||||
- **`bx-cli run`** stages the configured GDK's `xg_xs.dll` (in place of the `xg_xs` shim) and `BCPack.dll` (named to `XCRDAPI.dll` through `BX_BCPACK_DLL`) when the executable is the configured target build, or with `--gdk-libraries`; `--no-gdk-libraries` turns it off. The libraries are recognised by their exports (`gdk_libs.rs`), copied into a temporary shim folder for the run, and never committed. Conformance tests keep BetterXen's own shims.
|
||||
- **`d3d12_xs.dll`** answers `GetResourceAllocationInfo`, `GetResourceAllocationInfo1` and `GetResourceAllocationInfo2` for console texture layouts (`Layout >= 0x100`) with the GDK's XG size and base alignment (`gdk_xg.cpp`), other descriptions with the host's answer, laid out in order at their alignments. It enables XG's exclusive locking at device creation, since the title and the shim both create XG texture computers. Without the GDK's XG, sizes stay as before and the run log says so (`gdk_xg`).
|
||||
- **Tests:** `test_d3d12_gdk_xg_sizes` loads a stand-in XG library with answers the test computes (not Microsoft's code) and checks the sizes, alignments, the two-description layout and the locking. On the previous `d3d12_xs.dll` 6 checks fail; with this change it passes twice. `bx-cli` unit tests cover recognising the libraries by their exports and merging them beside the shims.
|
||||
- **Measured** on the target build (Apple Silicon, CrossOver 26.3, offline, scripted input): the launcher staged both libraries; XG answered 48 console-layout size queries; with #709, 0 page-destination errors, 0 zlib failures and 0 refused BCPack requests. 14 partial reads of compressed blocks remain, so the allocation size is not the only place the title gets a short size (#708 stays open).
|
||||
- `GameInput.dll` exposes one keyboard-backed gamepad through v0 blocking enumeration and current readings. Enter or Space maps to A, Escape or Backspace to B, arrow keys to the D-pad, WASD and IJKL to the two sticks, Q/E to shoulders, Z/C to triggers, F/H to stick clicks, X/Y to the matching face buttons, and P/Tab to Menu/View. Input returns to neutral when another application owns the foreground.
|
||||
- **D3DMetal capability checks for translated console shaders** (#671). `test_d3dmetal_translator_caps` measures, against the host D3D12 runtime, the features a translator of console code needs: SM 6.6 descriptors fetched by index (UAV, raw and typed SRVs, texture and sampler) run correctly; a 64-lane wave emulated over a 64-thread group gives the 64-lane answers through groupshared memory and through merged 32-lane host waves; amplification and mesh shaders draw correctly. With the 64-bit atomic results of `test_d3dmetal_gpu_limits` (native 64-bit atomics are not run even though D3DMetal reports support; the lock emulation with a 1024 cap is exact), no need is blocked. Results are in [D3DMetal GPU limits](docs/research/d3dmetal-gpu-limits.md#capability-checks-for-translated-console-shaders-671).
|
||||
- `xgameruntime.dll` serves `XGameSaveGetContainerInfo` (slot 13) and `XGameSaveEnumerateContainerInfoByName` (slot 15) on `IXGameSaveImpl` (#667). `XGameSaveGetContainerInfo` reads container metadata without loading blob payloads and, when the named container does not exist, succeeds without invoking the callback (source rank 3 inference). `XGameSaveEnumerateContainerInfoByName` filters containers by name prefix (treating `nullptr` or empty prefix as all containers), sorts by name, and stops early when the callback returns `false`. `test_xgameruntime_saves` checks both slots through `QueryApiImpl`.
|
||||
- `xgameruntime.dll` serves `XAsyncRun`, `XTaskQueueCreateComposite`, `XTaskQueueGetPort` and `XTaskQueueDuplicateHandle` through `IXGameRuntimeCore` slots 6, 13, 14 and 15 (#666). `XAsyncRun` runs the title's work callback on the block's work port and completes the block with its result. A duplicated queue handle shares the queue, and only the last close shuts its lanes down. A composite queue forwards each port to the port it was made from, and an async block's completion returns through the queue the block named. A project-authorized target build uses these for its save-game work and exited when `XAsyncRun` was unimplemented. `test_xgameruntime` checks all four through `QueryApiImpl`.
|
||||
- `bx-cli report <log.jsonl>...` (#664, part 1): a run report per log (one log is one run) and a summary across runs. Per run: how it ended, the frames presented (a lower bound), every unimplemented call with its count, faults whose innermost frame is in a BetterXen module, and pipelines by kind. The summary counts clean runs and lists each blocker signature with the number of runs that hit it; blocker issues are titled with those signatures. `bx-cli run` now appends a `run_end` record to its log (exited with a status, timeout, signal or launch failure), which the report reads. A log without it has an unknown outcome and is never counted as clean.
|
||||
@@ -91,11 +104,25 @@ remains unsupported.
|
||||
- `d3d12_xs.dll!D3D12ConfigureVirtualMemoryX` now decodes the Xbox virtual-memory configuration (`D3D12XBOX_VIRTUAL_MEMORY_CONFIGURATION`) alongside the existing `BXVM` contract. Layout and behaviour follow the authorized GDK documentation of the function and structure: no flags, a GPU page-table size in 4 MB units clamped to 33, a frame-buffer preserve size (0, -1 for the legacy size, or bytes clamped to 64 MiB), and two output addresses, the minimum always 2 GiB and the maximum 159.375 GiB at the default 5 pages. The call fails with `E_FAIL` once a D3D12 device exists. Call-site observation of a project-authorized target build agrees with the documented layout. Inferred, and marked as such: the maximum for other page-table sizes scales linearly (`max_estimated=1` in the log), and a page-table size of 0, an unreadable configuration or unwritable outputs fail with `E_INVALIDARG`. The host sizes no GPU page tables and keeps no cross-process frame buffer, so the path records both (`vmem_config_recorded`, `applied=0 recorded_only=1`), leaves the `BXVM` record and cached backing heap untouched, and still emits `BX_STUB_LOG`. `tests/conformance/test_d3d12_vmem_xbox/` checks the documented outputs, clamps and post-device `E_FAIL`, the refused cases, and that a cached `BXVM` backing heap survives.
|
||||
|
||||
### Fixed
|
||||
- **`XCRDAPI.dll`: physical-page destinations are mapped when the request runs, partial reads of compressed blocks are delivered, and BCPack requests can be decoded.**
|
||||
- **Page array timing:** a title can fill the `DestinationPageArray` of a `DestinationIsPhysicalPages` request after `EnqueueRequest` returns. #707 read the array at enqueue, so such requests failed (in the target build, about 290 per run named page 0). The array is now read, and its pages mapped, when the request runs; they are unmapped once it is fulfilled.
|
||||
- **Partial compressed reads:** a title may ask for only the first `DestinationSize` bytes of a zlib block (in the target build, 8 to 128 KiB blocks read 4 to 16 KiB at a time; 16 failures per run). The whole stream is decoded, its Adler-32 checked, and its first `DestinationSize` bytes delivered; a stream shorter than the destination is still an error. Logged as `dstorage_zlib_partial`.
|
||||
- **BCPack:** a request with `BcpackMode` 1 to 7 is decoded with `BCPackDecompress` from the GDK's own `BCPack.dll` when `BX_BCPACK_DLL` names it (the collaborator's GDK; nothing from the GDK is shipped). Without it, or combined with zlib, BCPack stays refused with `E_NOTIMPL`. Logged as `bcpack_codec` and `dstorage_bcpack_failed`.
|
||||
- **Tests:** `test_xcrdapi_page_destination` (24 checks) adds a page array filled after `EnqueueRequest` and a 4096-byte zlib destination from a 136000-byte stream (exact first part, nothing written past it). Both fail on the previous shim (4 checks) and pass twice with this one. BCPack needs the GDK's decoder, so it is not covered by a conformance test.
|
||||
- **`GetFrameStatisticsX` is implemented** (#701). Slot 81 of the Xbox device table returned `E_NOTIMPL`, which the documented method never returns. It now answers as the authorized GDK documentation describes: frame-event (ORIGIN: wait call, signal and wait return) and present (PresentX call and return) statistics per frame pipeline token for the last 17 frames, in QueryPerformanceCounter ticks; `S_FALSE` when none of the requested types is available; `E_INVALIDARG` for unknown tokens, invalid type sets and invalid list arrangements. Interval, power-scaling, render, display and input statistics have no host source and are never reported; `GPUProcessTime` is 0 (not measured). Test: `test_d3d12_frame_statistics_x`.
|
||||
- **`CreateCommittedResourceX` is implemented** (#696). Slot 76 of the Xbox device table takes a `D3D12XBOX_RESOURCE_DESC`, which is the PC resource description followed by `DccOptions` (authorized GDK header). It now creates the resource from the PC part through the same path as `CreateCommittedResource` (console format translation, the `XMemAlloc` request a title's hook sees); `DccOptions` (a struct of `CompressionLevel` and `ColorTransform`), console colour compression, has no host counterpart; both fields are logged for the first 8 calls and ignored. Until now the slot returned `E_NOTIMPL`, and the target build exited with status 99 about a second after it was refused. `tools/gen_xbox_tables.py` routes the slot to the new entry point; the regenerated table differs only there. Test: `test_d3d12_committed_resource_x`.
|
||||
- `xmem.dll!XMemGetWorkingSetStatistics` takes the documented `(WorkingSetFlags, Statistics)` and fills the documented 120-byte `XMEM_WORKING_SET_STATISTICS` (source: the authorized GDK header). Before, it took `(out_stats, stats_size)` and wrote BetterXen's own 32-byte `bx_xmem_stats_t`. A title calling it as documented had its flags read as the output address and its structure pointer as the size, and the shim zeroed memory at the flags value. A project-authorized target build calls it on a tools-memory path with the tools and kernel-pool flags and treats `FALSE` as fatal; runs have not reached that path yet.
|
||||
- **Values:** the whole structure is written, whatever the flags. `GameLimit` is the title cap, `GameUsed` everything the cap counts (XMem heap, virtual commits, physical pages and external charges), `GameUsedPeak` its highest value and `GameAllocatedPhysicalPageCount` the 64 KiB physical pages. The tools fields are 0, since `XMemIsToolsMemAvailable` is `FALSE`. The counters the host does not have or xmem does not count are 0 (stack, GPU-optimal bandwidth, kernel pool, DirectStorage, frame-preserve buffer, page tables), and so are the reserved words. These values are BetterXen's inference.
|
||||
- **Refusals:** a NULL structure, or flags outside the five `XMEM_WORKING_SET_*` values, fails with `ERROR_INVALID_PARAMETER` and logs `working_set_statistics`. `bx_xmem_get_internal_stats` is unchanged for internal callers.
|
||||
- **Tests:** new `test_xmem_working_set` reads the structure between guard bands at offsets written out from the header, with the tools and kernel-pool flags, `XMEM_WORKING_SET_TITLE` and `XMEM_WORKING_SET_ALL`. Against the previous `xmem.dll` it fails with an access violation inside the call. `test_xmem`, `test_xmem_physical`, `test_xmem_external_charge` and `test_d3d12_placed` use the documented form. `test_xmem_physical` now reads its two aliased page views through `volatile`: the compiler cannot see that they share a page, and after this change it scheduled the read before the write.
|
||||
- **Not covered:** `XMemVirtualQuery` and `XMemTransferMemory` still differ from their documented signatures (#642).
|
||||
- **`XCRDAPI.dll`: DirectStorage requests can write into physical pages** (#705). With `DestinationIsPhysicalPages` (bit 21 of `DSTORAGE_REQUEST_OPTIONS`), the destination of an Xbox request is an array of 64 KB page numbers from `XMemAllocatePhysicalPages` and a 16-bit offset into the first page, at +0x08 and +0x10 (authorized GDK header). `IDStorageQueueX::EnqueueRequest` refused such requests with `E_NOTIMPL`, and the target build stopped at a breakpoint about two milliseconds later (exit status 3). The request now maps its pages through `xmem.dll`'s `XMemMapPhysicalPages` with a NULL address (the existing BetterXen extension) into a span of its own, writes the destination there, file or memory source, plain or zlib, and unmaps the span once it is fulfilled; the pages are sections, so the title's views see the bytes. A physical-page source (`SourceIsPhysicalPages`) is still refused and logged as `EnqueueRequest_physical_page_source`. Test: `test_xcrdapi_page_destination` (19 checks: a zlib file request across three pages given out of order from an offset, an uncompressed memory request across a page boundary, an unallocated page number, the refused source form).
|
||||
- **`d3d12_xs.dll`: index and vertex data bound from plain title memory are drawn.** A title keeps such data in its own memory with no Direct3D resource, and may write it after recording the draw. A bound range now gets a CPU-writable host buffer (once; later ranges inside it reuse it) and every range bound on a list is copied from the title memory when the list is submitted (`bx_xbox_bind_title_memory`, `placed_x.cpp`). This replaces leaving such bindings empty; only memory that is not readable is still left empty and logged as unimplemented. Tests: `test_d3d12_title_memory_geometry` (26 checks, pixel readback, data written after recording and changed between submissions); `test_d3d12_unbacked_buffers` now covers the unreadable case.
|
||||
- **`d3d12_xs.dll`: console rectangle lists are drawn.** `D3D_PRIMITIVE_TOPOLOGY_RECTLIST` (17) and the pipeline topology type `D3D12XBOX_PRIMITIVE_TOPOLOGY_TYPE_RECT` (19) are Xbox extensions (GDK `d3d12_xs.h`): three vertices per rectangle, the fourth corner `v0 + v2 - v1`. The host knew neither value, so a title's full-screen passes drew half a rectangle or nothing. A rectangle list is now drawn as triangle strips (`rect_list.cpp`): the pipeline is created with the triangle type, and a non-indexed draw builds four vertices per rectangle from the title's vertex data and the pipeline's input layout. Indexed rectangle lists and quad lists are not emulated and are logged as unimplemented. Test: `test_d3d12_rect_list` (25 checks, pixel readback).
|
||||
- **`bx_runtime_veh.dll`: a CLWB range loop completes in one exception.** A title flushes an address range with `clwb [reg]; add reg, 0x40; cmp reg, <reg64>; jbe|jb`; each CLWB trapped under Rosetta, about 94,000 exception round trips per 6 MiB buffer. CLWB changes no register, flag or memory, so the handler now advances the pointer register to the last value the loop would have used and the title's own add/cmp/jcc leaves the loop. Other forms keep the per-instruction path. Test: `test_veh_clwb_loop` (15 checks; without the fix the four loop cases take one exception per line).
|
||||
- **Committed render targets request the console's size from XMemAlloc** (#695). The console lays out a 2D render-target or unordered-access texture with one mip and one sample in 64 KB tiles (64KB_R_X for every size: 128x128 elements at 4 bytes, 128x64 at 8, 64x64 at 16, 256x128 at 2, 256x256 at 1; authorized GDK XG library), and a title that hooks XMemAlloc sizes its pool for those requests and asserts that less than 2 MB is left over. `d3d12_xs.dll` requested the host's size instead, 1920x1080 RGBA8 as 128 pages where the console takes 135, and on the Series S path the target build stopped on that assertion. The XMemAlloc request for those textures is now the tile size, computed from the title's format; every other resource keeps the host's size, and XG's render-target compression metadata after the tiles (8 KB to 96 KB in the cases measured) is not modelled. `GetResourceAllocationInfo` still answers with the host's size. Test: `test_d3d12_committed_tile_size`.
|
||||
- **XCRDAPI holds an xmem guard while accessing title memory** (#668). Replacing a mapped view on Windows or Wine can temporarily make pages in that view inaccessible. DirectStorage reads and writes that can touch title memory now hold the shared guard while xmem mapping and freeing operations hold it exclusively. A loaded xmem DLL without both guard exports produces a warning. The guard covers DirectStorage accesses through BetterXen.
|
||||
- **The console type is published where a title reads it** (#692). A title can read the REG_DWORD `ConsoleMode` under `HKLM\Software\Microsoft\Windows NT\CurrentVersion\OEM` instead of calling `XSystemGetDeviceType`: 0x60 is Series S, 0x64 Series X and 0x68 the Scarlett devkit, and without the value the title takes itself for a PC and sizes its memory for Series X. Wine has no such value, so under the Lockhart profile the target build asked for its Series X memory set and stopped on the 8 GiB budget. `bx-cli run` writes the value in the selected Wine environment before launching the guest, using the same profile as `XSystemGetDeviceType` (0x60 for Lockhart, 0x64 for Anaconda). `--profile` is matched without regard to case, as the shims match `BX_PROFILE`, and a value other than `lockhart` or `anaconda` is refused, so the two cannot name different consoles. The test `test_console_mode` reads it the way the title does and checks it against the profile and `XSystemGetDeviceType`.
|
||||
- **XCRDAPI holds an xmem guard while accessing title memory** (#668). Replacing a mapped view on Windows or Wine can temporarily make pages in that view inaccessible. DirectStorage reads and writes that can touch title memory now hold the shared guard while xmem mapping and freeing operations hold it exclusively. A loaded xmem DLL without both guard exports produces a warning. The guard covers DirectStorage accesses through BetterXen. `test_xcrdapi_remap_guard` exercises memory-to-memory stores into a window, zlib streams inflated into it and memory requests reading out of it while it is remapped; accesses by the title's own threads are not covered.
|
||||
- **`d3d12_xs.dll`: an index or vertex binding at a title address without a host buffer no longer crashes the process.** A title binds index and vertex data by address in plain title memory, with no Direct3D resource behind it. The address reached D3DMetal unchanged and it read through a null buffer (`IASetIndexBuffer`). Such a binding is now left empty and logged as unimplemented (`IASetIndexBuffer(title memory without a host buffer)`, likewise `IASetVertexBuffers`); bindings inside resources BetterXen created are translated as before. Supplying the data is separate work. Test: `test_d3d12_unbacked_buffers` (13 checks; without the fix it dies with the same null read).
|
||||
- **`d3d12_xs.dll`: console-only DXGI formats and depth-stencil unordered-access views no longer end the process.** The Xbox Series `DXGI_FORMAT` enumeration has values the PC one lacks (116-120, 189, 190; GDK `d3d12_xs.h`). D3DMetal turns one into an invalid Metal pixel format and Metal aborts, which a target build's crash reporter then turned into either "exit status 5" or a stall with every thread stopped.
|
||||
- **Formats:** `console_formats.h` maps each to the nearest host format (a depth texture is created typeless, each view names the concrete format). The three `GetResourceAllocationInfo` forms, `CreatePlacedResource`, `CreateReservedResource`, the four view-creation methods, the committed-resource forms and the placed (X) resource and view forms translate before the host call.
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
- [ADR 0006: Retire in-tree native-first workspace](adr/0006-retire-in-tree-native-workspace.md) — Retirement of paused native code/scripts/docs from `main` (preserved at Git tag `native-first-final`).
|
||||
- [ADR 0007: API-set win32_bridge shims under CrossOver](adr/0007-api-set-shims-under-crossover.md) — Accepted: CrossOver answers the six API-set import names itself, so the shims are not loaded for static imports.
|
||||
- [ADR 0008: M2 Shader Format Gate](adr/0008-m2-shader-format-gate.md) — Proposed: Branch D1 (DXIL through D3DMetal, with the measured wave64 and 64-bit-atomic gaps as M3 work); ACCC-only containers refused with `E_NOTIMPL` until a lawful format source exists.
|
||||
- [ADR 0010: The GDK's texture libraries at run time](adr/0010-gdk-texture-libraries.md) — Accepted: console texture layouts and BCPack come from the GDK's own PC libraries (`xg_xs.dll`, `BCPack.dll`), staged by `bx-cli run` for the target build from each machine's GDK; never reimplemented, committed or shipped.
|
||||
- [ADR 0009: Xbox-layout D3D12 objects](adr/0009-xbox-layout-d3d12-objects.md) — Proposed: `d3d12_xs` gives titles objects with the Xbox object layout and function-table order (generated from the Xbox header), hosting the PC proxies; Phase 1 covers the device chain and the objects it creates.
|
||||
|
||||
## Research, Testing & Licensing
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# ADR 0010: The GDK's texture libraries at run time
|
||||
|
||||
Status: **Accepted** (2026-11-30, by the repository owner). The evidence is from local Apple Silicon runs by the implementer.
|
||||
|
||||
## Context
|
||||
|
||||
Console textures differ from PC textures in two ways that BetterXen had no answer for:
|
||||
|
||||
- **Tiled layouts.** A console texture carries a swizzle layout (`D3D12XBOX_TEXTURE_LAYOUT`, `0x100 | XG_SWIZZLE_MODE`; most of the target build's textures use the 4 KB "S" mode). A title sizes its placements and loads from the layout, and the bytes arrive tiled. BetterXen's `xg_xs` shim answers every layout as linear, so sizes were too small (#708) and textures could not be uploaded.
|
||||
- **BCPack.** Texture data in the target build's archives is BCPack-compressed (`DSTORAGE_BCPACK_MODE` 1 to 7). There is no public specification of the format. `XCRDAPI.dll` refused those requests (34 per run).
|
||||
|
||||
The GDK the project is authorized to use contains Microsoft's **PC builds** of both: the XG library (`xg_xs.dll`, which computes layouts and copies between tiled and linear data) and the BCPack decoder (`BCPack.dll`). Both are pure computation, with only standard Windows imports, and load under CrossOver. Measured on the target build with them in place: the GDK's XG answers the device's console-layout size queries, detiling through it produced the first real image of the title's menu artwork, and BCPack requests decode.
|
||||
|
||||
Reimplementing either would mean deriving the console's tiling rules and the BCPack format from observation, with the result only ever approximating Microsoft's.
|
||||
|
||||
## Decision
|
||||
|
||||
1. **Use Microsoft's libraries at run time; do not reimplement them.** `bx-cli run` stages the GDK's `xg_xs.dll` in place of BetterXen's shim and `BCPack.dll` beside it, and names the decoder to `XCRDAPI.dll` through `BX_BCPACK_DLL` (`launcher/crates/bx-cli/src/gdk_libs.rs`). `d3d12_xs` uses the XG library when it is the loaded `xg_xs.dll` (`shims/d3d12_xs/gdk_xg.cpp`).
|
||||
2. **From each machine's own GDK.** The libraries come from the GDK configured by `bx-cli setup`, which preflight already requires. They are found by their exports, not their place in the GDK.
|
||||
3. **Never committed or shipped**, unless the project records an authorization that covers redistributing them. Commits name only the documented interfaces (`XGCreateTextureComputer`, `BCPackDecompress`, ...), as with every other GDK contract.
|
||||
4. **Only for the target build.** Conformance tests check BetterXen's own shims, so the GDK's libraries are staged only when the executable is the configured target build, or with `--gdk-libraries`. `--no-gdk-libraries` turns them off.
|
||||
5. **BetterXen's `xg_xs` shim stays** as the fallback (and for CI, which has no GDK). Without the GDK's XG, console textures are sized linearly, and the run log says so (`gdk_xg`).
|
||||
|
||||
## Consequences
|
||||
|
||||
- Correct console layouts and BCPack decoding now, without a reverse-engineering effort for either.
|
||||
- Running the title needs the GDK on the machine. Preflight already requires it.
|
||||
- Conformance tests cannot call Microsoft's libraries in CI. Tests cover BetterXen's side of the contract with stand-ins whose answers the test computes (`test_d3d12_gdk_xg_sizes`). Microsoft's results are exercised on machines with the GDK.
|
||||
- Agents need no special knowledge: the target build's run protocol stages the libraries automatically, and `CLAUDE.md` Section 1 says not to reimplement them.
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**Status: in effect since 2026-11-29** (#662), together with [AGENTS.md §0](../../AGENTS.md). The pinned ladder issue is #663.
|
||||
|
||||
BetterXen is built by collaborators who each have the project-authorized target build and the GDK, and who work by pointing a coding agent at this repository and saying **"work"**. This document answers one question for an agent that has just been told to work: *what is the single most useful thing to do now, and how do I do it without colliding with the other agents?*
|
||||
BetterXen is built by collaborators who each have the project-authorized target build, the GDK and the target build's Ghidra results, and who work by pointing a coding agent at this repository and saying **"work"**. This document answers one question for an agent that has just been told to work: *what is the single most useful thing to do now, and how do I do it without colliding with the other agents?*
|
||||
|
||||
The short answer: run the build, fix the first thing it stops on, and open a pull request. The pull request is the unit of work. There are no meetings, no rotating roles and no backlog to interpret.
|
||||
|
||||
@@ -13,11 +13,14 @@ No agent works without all of these. `bx-cli preflight` checks them and fails if
|
||||
- an Apple Silicon Mac with CrossOver, D3DMetal and `mingw-w64`;
|
||||
- **the project-authorized target build**;
|
||||
- **the GDK**, headers and compilers, under the project's authorization;
|
||||
- **the Ghidra results of the target build**: the static-analysis run (`RUN_REPORT.md`, `exports/`, `decompiled/`) covering its executable;
|
||||
- at least 10 GiB of free disk space.
|
||||
|
||||
A collaborator only says "work". When preflight fails, the agent makes the machine ready itself: `bx-cli setup --find` searches the home folder, recognises the GDK by its header and the target build by its structure (never by name), and saves both in `~/.config/betterxen/local.conf`, outside the repository, where every worktree and agent session on that machine finds them. It installs missing build tools with Homebrew and frees disk space by removing its own scratch.
|
||||
The target build, the GDK and the Ghidra results are a hard requirement: an agent that lacks even one of them does not work on the repository at all.
|
||||
|
||||
Work here is found by running the build and checked against the GDK. Without them an agent can only guess, and a guess that looks like a fix costs a reviewer more than it saves. An agent stops only for what it cannot supply: the host is not an Apple Silicon Mac, CrossOver is not installed, the build or the GDK is not on the machine, or more than one distinct build is (the choice is the collaborator's). Then it says exactly which, and does not write fixes, tests or reviews "for someone else to verify".
|
||||
A collaborator only says "work". When preflight fails, the agent makes the machine ready itself: `bx-cli setup --find` searches the home folder, recognises the GDK by its header, the target build by its structure (never by name) and the Ghidra results by their layout and the program they cover, and saves all three in `~/.config/betterxen/local.conf`, outside the repository, where every worktree and agent session on that machine finds them. It installs missing build tools with Homebrew and frees disk space by removing its own scratch.
|
||||
|
||||
Work here is found by running the build, located in the Ghidra results and checked against the GDK. Without all three an agent can only guess, and a guess that looks like a fix costs a reviewer more than it saves. An agent stops only for what it cannot supply: the host is not an Apple Silicon Mac, CrossOver is not installed, the build, the GDK or the Ghidra results are not on the machine, or more than one distinct build is (the choice is the collaborator's). Then it says exactly which, and does not write fixes, tests or reviews "for someone else to verify".
|
||||
|
||||
## Why this shape
|
||||
|
||||
@@ -82,11 +85,12 @@ run → signature → draft pull request (the claim) → evidence → smallest f
|
||||
```
|
||||
|
||||
1. **Claim with a draft pull request.** Check open pull requests for the signature. If nobody has it, branch from `origin/main`, push, and open a draft titled `[<Stage>] <signature>`. A draft with no push for 3 days may be taken over.
|
||||
2. **Evidence before code.** Find what the build asked for and what it got: the run report, then the diagnostics (thread sampler, fault context, call trace). Check the contract against the GDK where the GDK covers it. Do not guess a fix.
|
||||
3. **Smallest fix.** Only what removes this blocker. A new cross-DLL export still goes through an `[ABI]` pull request first.
|
||||
4. **A test for the contract.** It fails without the fix and passes twice in a row in the same bottle.
|
||||
5. **Proof.** Runs before and after on your machine, every run reported. Say which start-up path your runs took: another machine may take a different one.
|
||||
6. **Mark it ready** with the five-part description. Then stop: the next "work" starts from the top of the list.
|
||||
2. **Is it already someone's?** Before investigating any problem the game shows (the picked blocker or one met along the way), search open and merged pull requests and open issues for its log event, stub symbol, error code and the files a fix would touch. If an open pull request covers it, check that branch out, run with it and work there. If a merged one does, sync and run again. On 2026-11-30 a session fixed physical-page DirectStorage requests in parallel with an open pull request for the same problem (#707), and found the overlap only afterwards.
|
||||
3. **Evidence before code.** Find what the build asked for and what it got: the run report, then the diagnostics (thread sampler, fault context, call trace). Check the contract against the GDK where the GDK covers it. Do not guess a fix.
|
||||
4. **Smallest fix.** Only what removes this blocker. A new cross-DLL export still goes through an `[ABI]` pull request first.
|
||||
5. **A test for the contract.** It fails without the fix and passes twice in a row in the same bottle.
|
||||
6. **Proof.** Runs before and after on your machine, every run reported. Say which start-up path your runs took: another machine may take a different one.
|
||||
7. **Mark it ready** with the five-part description. Then stop: the next "work" starts from the top of the list.
|
||||
|
||||
If the blocker turns out to be more than you can finish, close the draft and file a handoff issue.
|
||||
|
||||
|
||||
@@ -127,6 +127,26 @@ for a recording recipe. Through `bx-cli run` the guest status is returned unchan
|
||||
Still to do for the issue's validation requirement: an independent run on CrossOver 26.3
|
||||
(D3DMetal 3.0) by another contributor.
|
||||
|
||||
## Capability checks for translated console shaders (#671)
|
||||
|
||||
A translator of console code needs four things from D3DMetal. Each has a synthetic check with
|
||||
one of three results: *runs correctly*, *workaround* (the translator can get the console's
|
||||
answer another way) or *blocked*. The checks talk to the host `d3d12.dll` directly, so they
|
||||
measure D3DMetal, not BetterXen. Expected values are computed on the CPU.
|
||||
|
||||
Machine: Apple M5 (32 GB), macOS 27.2.1, CrossOver 26.3, D3DMetal; each check run twice in a
|
||||
row with the same result.
|
||||
|
||||
| Need | Check | Result | What was measured |
|
||||
| --- | --- | --- | --- |
|
||||
| Descriptors fetched by index (SM 6.6 dynamic resources) | `test_d3dmetal_translator_caps` `heap_index` | **runs correctly** | Resource binding tier 3. A UAV, a raw SRV, a typed SRV, a texture and a sampler, all taken from the descriptor heaps by index (`ResourceDescriptorHeap`, `SamplerDescriptorHeap`, root signature flags `CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED` and `SAMPLER_HEAP_DIRECTLY_INDEXED`): all 65 values correct. |
|
||||
| 64-lane waves | `test_d3dmetal_translator_caps` `wave64`, with `test_d3dmetal_gpu_limits` `wave` | **workaround** | The host runs 32-lane waves (`WaveLaneCountMin = Max = 32`), and a `[WaveSize(64)]` kernel is created but not run (above). A 64-thread group standing for one 64-lane wave gives the 64-lane ballot, exclusive prefix sum, read-lane and sum on all 64 lanes, both through groupshared memory and through the host's own wave operations merged across its two waves. |
|
||||
| 64-bit atomics on typed resources | `test_d3dmetal_gpu_limits` `atomic64`, `lock64` | **workaround** | D3DMetal reports `AtomicInt64OnTypedResourceSupported = 1` and `AtomicInt64OnDescriptorHeapResourceSupported = 1`, but kernels using 64-bit atomics, on typed and on raw resources, are created and not run: even their plain stores are missing. The per-texel lock over 32-bit words with a retry cap of 1024 is exact (0 of 512 updates dropped); with a cap of 64 it drops updates. A translator must not trust the reported support. |
|
||||
| Amplification and mesh shaders | `test_d3dmetal_translator_caps` `mesh` | **runs correctly** | `D3D12_MESH_SHADER_TIER_1` (enum value 10). An amplification shader passes a payload to two mesh groups through `DispatchMesh`; each draws half of a 4x4 target with a pixel shader: all 16 pixels correct. |
|
||||
|
||||
No need is *blocked*, so no ADR is required by #671. The shaders are regenerated with
|
||||
`tests/conformance/test_d3dmetal_translator_caps/shaders/compile.sh` (same DXC release as below).
|
||||
|
||||
## Unverified reports (not evidence)
|
||||
|
||||
Reported on #453 from local VIctory-macOS-based builds running a commercial title on one
|
||||
|
||||
@@ -94,7 +94,7 @@ sandbox-exec -p "$PROFILE" /usr/bin/curl -sS -m 5 https://example.com >/dev/null
|
||||
# 3. Run the title inside the same profile. Every process it starts, including the new
|
||||
# wineserver, inherits the sandbox.
|
||||
env -i HOME="$HOME" USER="$USER" TMPDIR="$TMPDIR" PATH=/usr/bin:/bin:/usr/sbin:/sbin \
|
||||
BX_TRACE_D3D=0 BX_NULL_RENDER=1 \
|
||||
BX_TRACE_D3D=0 BX_NULL_RENDER=1 BX_PRESENT_DUMP='Z:\<frames folder>' BX_INPUT_SCRIPT=A@40,A@50 \
|
||||
sandbox-exec -p "$PROFILE" target/debug/bx-cli run --inherit-env \
|
||||
--bottle "$BOTTLE" --backend d3dmetal --profile <profile> \
|
||||
--log <run>.jsonl --shims build-shims/bin --exe <path to the title executable>
|
||||
@@ -116,6 +116,8 @@ All switches are off unless set, and none changes behaviour beyond what its row
|
||||
| `BX_NULL_RENDER=1` | `d3d12_xs` | Pipelines that cannot be built become null pipelines; their draws and dispatches are skipped and logged |
|
||||
| `BX_PRESENT_DUMP=<folder>` | `d3d12_xs` | Writes presented frames as BMP files, every Nth present (`BX_PRESENT_DUMP_EVERY`, default 64) |
|
||||
| `BX_XMEM_TRACE=1` | `xmem` | Logs physical page allocations, frees and mappings |
|
||||
| `BX_INPUT_SCRIPT=<presses>` | `GameInput` | Scripted gamepad presses for unattended runs, without window focus: comma-separated `BUTTON@SECONDS` (`A@40,DOWN@50.5,A@52`), each held 300 ms, timed from the first gamepad reading. Buttons `MENU VIEW A B X Y UP DOWN LEFT RIGHT`. Each press is logged (`input_script`), and so is each entry that cannot be read |
|
||||
| `BX_CONTINUE_ASSERTS=1` | `bx_runtime_veh` | Steps over an `int3` in the title's own executable (a continuable assert) instead of letting it reach the title's crash reporter. Each address is logged once (`assert_continued`), so the report still lists every assert. Use it to get past a known assert to the next blocker, and say so in the evidence |
|
||||
|
||||
Their output can contain title addresses and file names, so it goes only into the private evidence store.
|
||||
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
//! The GDK's own texture libraries, staged for runs of the target build (ADR 0010).
|
||||
//!
|
||||
//! Console textures use tiled layouts and BCPack compression. BetterXen does not reimplement
|
||||
//! either: a run of the target build loads Microsoft's PC builds of the GDK's XG library
|
||||
//! (`xg_xs.dll`, in place of BetterXen's `xg_xs` shim) and BCPack decoder (`BCPack.dll`, named to
|
||||
//! `XCRDAPI.dll` through `BX_BCPACK_DLL`) from the GDK configured on this machine. Nothing from
|
||||
//! the GDK is committed or shipped.
|
||||
//!
|
||||
//! The libraries are recognised by what they export, never by their place in the GDK: an
|
||||
//! x86-64 PE32+ file named `xg_xs.dll` that exports `XGComputeTexture2DLayout` and does not
|
||||
//! import `xmem.dll` (the console build does), and one named `BCPack.dll` that exports
|
||||
//! `BCPackDecompress`. Conformance tests keep BetterXen's own shim: the GDK's are staged only
|
||||
//! for the configured target build, or with `--gdk-libraries`.
|
||||
|
||||
use std::fs;
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use bx_probe::probe_pe32_plus;
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq)]
|
||||
pub struct GdkLibraries {
|
||||
pub xg: Option<PathBuf>,
|
||||
pub bcpack: Option<PathBuf>,
|
||||
}
|
||||
|
||||
fn contains(bytes: &[u8], needle: &[u8]) -> bool {
|
||||
bytes.windows(needle.len()).any(|w| w == needle)
|
||||
}
|
||||
|
||||
/// Whether `bytes` are the PC build of the GDK's XG library.
|
||||
pub fn is_pc_xg(bytes: &[u8]) -> bool {
|
||||
let Ok(summary) = probe_pe32_plus(bytes) else {
|
||||
return false;
|
||||
};
|
||||
contains(bytes, b"XGComputeTexture2DLayout\0")
|
||||
&& contains(bytes, b"XGCreateTextureComputer\0")
|
||||
&& !summary
|
||||
.imports
|
||||
.keys()
|
||||
.any(|dll| dll.eq_ignore_ascii_case("xmem.dll"))
|
||||
}
|
||||
|
||||
/// Whether `bytes` are the GDK's BCPack decoder.
|
||||
pub fn is_bcpack(bytes: &[u8]) -> bool {
|
||||
probe_pe32_plus(bytes).is_ok() && contains(bytes, b"BCPackDecompress\0")
|
||||
}
|
||||
|
||||
/// Finds the two libraries under `root` (bounded depth). When the GDK holds several builds,
|
||||
/// the first by path order is used, so the choice is the same on every run.
|
||||
pub fn find(root: &Path) -> GdkLibraries {
|
||||
let mut xg = Vec::new();
|
||||
let mut bcpack = Vec::new();
|
||||
let mut stack = vec![(root.to_path_buf(), 0usize)];
|
||||
while let Some((dir, depth)) = stack.pop() {
|
||||
let Ok(entries) = fs::read_dir(&dir) else {
|
||||
continue;
|
||||
};
|
||||
for entry in entries.flatten() {
|
||||
let path = entry.path();
|
||||
let Ok(kind) = entry.file_type() else {
|
||||
continue;
|
||||
};
|
||||
if kind.is_dir() {
|
||||
if depth < 14 {
|
||||
stack.push((path, depth + 1));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
let name = entry.file_name().to_string_lossy().to_ascii_lowercase();
|
||||
if name != "xg_xs.dll" && name != "bcpack.dll" {
|
||||
continue;
|
||||
}
|
||||
let Ok(bytes) = fs::read(&path) else {
|
||||
continue;
|
||||
};
|
||||
if name == "xg_xs.dll" && is_pc_xg(&bytes) {
|
||||
xg.push(path);
|
||||
} else if name == "bcpack.dll" && is_bcpack(&bytes) {
|
||||
bcpack.push(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
xg.sort();
|
||||
bcpack.sort();
|
||||
GdkLibraries {
|
||||
xg: xg.into_iter().next(),
|
||||
bcpack: bcpack.into_iter().next(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds `out` as a copy of the shim folder's files with the GDK's libraries added: its
|
||||
/// `xg_xs.dll` replaces BetterXen's shim, and `BCPack.dll` sits beside it. Returns the path of
|
||||
/// the staged `BCPack.dll`, when there is one.
|
||||
pub fn merge_shims(shims: &Path, libs: &GdkLibraries, out: &Path) -> io::Result<Option<PathBuf>> {
|
||||
fs::create_dir_all(out)?;
|
||||
for entry in fs::read_dir(shims)? {
|
||||
let entry = entry?;
|
||||
if entry.file_type()?.is_file() {
|
||||
fs::copy(entry.path(), out.join(entry.file_name()))?;
|
||||
}
|
||||
}
|
||||
if let Some(xg) = &libs.xg {
|
||||
fs::copy(xg, out.join("xg_xs.dll"))?;
|
||||
}
|
||||
match &libs.bcpack {
|
||||
Some(bcpack) => {
|
||||
let staged = out.join("BCPack.dll");
|
||||
fs::copy(bcpack, &staged)?;
|
||||
Ok(Some(staged))
|
||||
}
|
||||
None => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// A minimal x86-64 PE32+ image with no sections, followed by `tail`. Import tables are
|
||||
/// not modelled, so "imports xmem.dll" is covered by `is_pc_xg` on a real probe only.
|
||||
fn pe(tail: &[u8]) -> Vec<u8> {
|
||||
let mut b = vec![0u8; 0x200];
|
||||
b[0..2].copy_from_slice(b"MZ");
|
||||
b[0x3C..0x40].copy_from_slice(&0x40u32.to_le_bytes());
|
||||
b[0x40..0x44].copy_from_slice(b"PE\0\0");
|
||||
b[0x44..0x46].copy_from_slice(&0x8664u16.to_le_bytes()); // machine
|
||||
b[0x54..0x56].copy_from_slice(&240u16.to_le_bytes()); // SizeOfOptionalHeader
|
||||
b[0x58..0x5A].copy_from_slice(&0x020Bu16.to_le_bytes()); // PE32+
|
||||
b[0x58 + 108..0x58 + 112].copy_from_slice(&16u32.to_le_bytes()); // NumberOfRvaAndSizes
|
||||
b.extend_from_slice(tail);
|
||||
b
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn recognises_the_libraries_by_their_exports() {
|
||||
assert!(is_pc_xg(&pe(
|
||||
b"XGCreateTextureComputer\0XGComputeTexture2DLayout\0"
|
||||
)));
|
||||
// BetterXen's own shim exports only what titles import.
|
||||
assert!(!is_pc_xg(&pe(
|
||||
b"XGCreateTextureComputer\0XGSuggestSwizzleMode\0"
|
||||
)));
|
||||
assert!(!is_pc_xg(
|
||||
b"XGCreateTextureComputer\0XGComputeTexture2DLayout\0"
|
||||
));
|
||||
assert!(is_bcpack(&pe(b"BCPackCompress\0BCPackDecompress\0")));
|
||||
assert!(!is_bcpack(&pe(b"BCPackCompress\0")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finds_by_content_and_merges_beside_the_shims() {
|
||||
let root = std::env::temp_dir().join(format!("bx-gdk-libs-{}", std::process::id()));
|
||||
let _ = fs::remove_dir_all(&root);
|
||||
let gdk = root.join("gdk");
|
||||
fs::create_dir_all(gdk.join("a/b")).unwrap();
|
||||
fs::create_dir_all(gdk.join("c")).unwrap();
|
||||
fs::write(
|
||||
gdk.join("a/b/xg_xs.dll"),
|
||||
pe(b"XGCreateTextureComputer\0XGComputeTexture2DLayout\0"),
|
||||
)
|
||||
.unwrap();
|
||||
fs::write(gdk.join("c/xg_xs.dll"), pe(b"XGCreateTextureComputer\0")).unwrap(); // not the PC library
|
||||
fs::write(gdk.join("c/BCPack.dll"), pe(b"BCPackDecompress\0")).unwrap();
|
||||
let libs = find(&gdk);
|
||||
assert_eq!(libs.xg, Some(gdk.join("a/b/xg_xs.dll")));
|
||||
assert_eq!(libs.bcpack, Some(gdk.join("c/BCPack.dll")));
|
||||
|
||||
let shims = root.join("shims");
|
||||
fs::create_dir_all(&shims).unwrap();
|
||||
fs::write(shims.join("xg_xs.dll"), b"shim").unwrap();
|
||||
fs::write(shims.join("d3d12_xs.dll"), b"d3d12").unwrap();
|
||||
let out = root.join("out");
|
||||
let staged = merge_shims(&shims, &libs, &out).unwrap();
|
||||
assert_eq!(staged, Some(out.join("BCPack.dll")));
|
||||
assert_eq!(fs::read(out.join("d3d12_xs.dll")).unwrap(), b"d3d12");
|
||||
assert_eq!(
|
||||
fs::read(out.join("xg_xs.dll")).unwrap(),
|
||||
fs::read(gdk.join("a/b/xg_xs.dll")).unwrap()
|
||||
);
|
||||
assert_eq!(fs::read(shims.join("xg_xs.dll")).unwrap(), b"shim");
|
||||
let _ = fs::remove_dir_all(&root);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
//! Track A (M1-A1): Native ARM64 macOS CLI for BetterXen hybrid execution.
|
||||
|
||||
mod drives;
|
||||
mod gdk_libs;
|
||||
mod stage;
|
||||
mod supervise;
|
||||
|
||||
@@ -10,7 +11,7 @@ use std::fmt::Write as _;
|
||||
use std::fs;
|
||||
use std::io::Write as _;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Command, ExitCode};
|
||||
use std::process::{Command, ExitCode, Stdio};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use bx_probe::{ShimTrack, classify_dll, probe_pe32_plus};
|
||||
@@ -26,6 +27,11 @@ ext-ms-win-rtcore-ntuser-window-l1-1-0,ext-ms-win-rtcore-ntuser-window-ansi-l1-1
|
||||
/// Accepted `--backend` values. CrossOver ignores an unknown value silently, so one is refused.
|
||||
const BACKENDS: [&str; 4] = ["d3dmetal", "dxmt", "dxvk", "wined3d"];
|
||||
|
||||
/// Accepted `--profile` values. The shims compare `BX_PROFILE` without regard to case and take
|
||||
/// anything but "anaconda" for Lockhart, while `ConsoleMode` is chosen here, so the value is
|
||||
/// normalized and an unknown one is refused instead of the two disagreeing.
|
||||
const PROFILES: [&str; 2] = ["lockhart", "anaconda"];
|
||||
|
||||
const SAFE_CHILD_PATH: &str = "/usr/bin:/bin:/usr/sbin:/sbin";
|
||||
|
||||
const HOST_ENV_ALLOWLIST: &[&str] = &[
|
||||
@@ -63,12 +69,12 @@ fn usage_text() -> &'static str {
|
||||
bx-cli doctor Inspect Apple Silicon host, Rosetta 2, CrossOver & mingw-w64\n\
|
||||
bx-cli probe <pe32+_path> Classify PE32+ imports by BetterXen track (A-E)\n\
|
||||
bx-cli shader <dxbc_blob_path> Classify a DXBC shader container (DXIL vs ACCC/FSPX)\n\
|
||||
bx-cli setup [--find] [--target-exe <path>] [--gdk-root <dir>] Remember where the target build and the GDK are on this machine (saved outside the repository); --find searches the home folder for them\n\
|
||||
bx-cli preflight Check everything work needs: host, CrossOver, the target build, the GDK, disk space. Fails if anything is missing\n\
|
||||
bx-cli setup [--find] [--target-exe <path>] [--gdk-root <dir>] [--ghidra-results <dir>] Remember where the target build, the GDK and the target build's Ghidra results are on this machine (saved outside the repository); --find searches the home folder for them\n\
|
||||
bx-cli preflight Check everything work needs: host, CrossOver, the target build, the GDK, the Ghidra results, disk space. Fails if anything is missing\n\
|
||||
bx-cli trace <log.jsonl> Summarize bx_runtime_veh JSONL diagnostics\n\
|
||||
bx-cli report <log.jsonl>... Run report per log (one log = one run), then a summary with blocker signatures\n\
|
||||
bx-cli run --exe <path> [--shims <dir>] [--bottle <name> | --prefix <dir>] [--profile lockhart|anaconda] [--log <path>] [--inherit-env] [--timeout <secs>] [--backend d3dmetal|dxmt|dxvk|wined3d (needs --bottle)]\n\
|
||||
(shims default to build-shims/bin; a timeout or signal stops the whole bottle or prefix)\n"
|
||||
bx-cli run --exe <path> [--shims <dir>] [--bottle <name> | --prefix <dir>] [--profile lockhart|anaconda] [--log <path>] [--inherit-env] [--timeout <secs>] [--backend d3dmetal|dxmt|dxvk|wined3d (needs --bottle)] [--gdk-libraries | --no-gdk-libraries]\n\
|
||||
(shims default to build-shims/bin; a timeout or signal stops the whole bottle or prefix; the GDK's XG and BCPack libraries are staged for the configured target build)\n"
|
||||
}
|
||||
|
||||
fn run_capture(program: &str, args: &[&str]) -> Option<String> {
|
||||
@@ -233,6 +239,57 @@ fn local_setting(env_name: &str, key: &str, config: &BTreeMap<String, String>) -
|
||||
|
||||
const TARGET_EXE_KEY: &str = "target_exe";
|
||||
const GDK_ROOT_KEY: &str = "gdk_root";
|
||||
const GHIDRA_RESULTS_KEY: &str = "ghidra_results";
|
||||
|
||||
/// The static-analysis results of the target build, recognised by structure: a folder with the
|
||||
/// run's `RUN_REPORT.md`, a `decompiled/` folder, and `exports/<program>/` folders each holding a
|
||||
/// `manifest.json` (naming the program) and a `functions.csv`.
|
||||
const GHIDRA_REPORT: &str = "RUN_REPORT.md";
|
||||
|
||||
/// The `"program"` value of an exports manifest, read without a JSON parser.
|
||||
fn manifest_program(text: &str) -> Option<String> {
|
||||
let rest = &text[text.find("\"program\"")? + "\"program\"".len()..];
|
||||
let rest = rest
|
||||
.trim_start()
|
||||
.strip_prefix(':')?
|
||||
.trim_start()
|
||||
.strip_prefix('"')?;
|
||||
Some(rest[..rest.find('"')?].to_owned())
|
||||
}
|
||||
|
||||
/// The programs a Ghidra results folder covers, or `None` when it is not one.
|
||||
fn ghidra_programs(root: &Path) -> Option<Vec<String>> {
|
||||
if !root.join(GHIDRA_REPORT).is_file() || !root.join("decompiled").is_dir() {
|
||||
return None;
|
||||
}
|
||||
let mut programs = Vec::new();
|
||||
for entry in fs::read_dir(root.join("exports")).ok()?.flatten() {
|
||||
let dir = entry.path();
|
||||
if !dir.join("functions.csv").is_file() {
|
||||
continue;
|
||||
}
|
||||
if let Some(program) = fs::read_to_string(dir.join("manifest.json"))
|
||||
.ok()
|
||||
.and_then(|text| manifest_program(&text))
|
||||
{
|
||||
programs.push(program);
|
||||
}
|
||||
}
|
||||
(!programs.is_empty()).then_some(programs)
|
||||
}
|
||||
|
||||
/// Whether the results cover the executable at `target` (by its file name, compared on this
|
||||
/// machine only).
|
||||
fn ghidra_covers(root: &Path, target: &Path) -> bool {
|
||||
let Some(name) = target
|
||||
.file_name()
|
||||
.map(|n| n.to_string_lossy().to_ascii_lowercase())
|
||||
else {
|
||||
return false;
|
||||
};
|
||||
ghidra_programs(root)
|
||||
.is_some_and(|programs| programs.iter().any(|p| p.to_ascii_lowercase() == name))
|
||||
}
|
||||
|
||||
/// An Xbox Series title's executable is recognised by structure, never by name: a large PE32+
|
||||
/// file that imports the console's D3D12 library. BetterXen's own test executables import it
|
||||
@@ -273,6 +330,7 @@ fn gdk_root_for(home: &Path, header: &Path) -> Option<PathBuf> {
|
||||
struct Found {
|
||||
gdk_roots: Vec<PathBuf>,
|
||||
target_exes: Vec<PathBuf>,
|
||||
ghidra_results: Vec<PathBuf>,
|
||||
/// The search gave up before visiting everything.
|
||||
truncated: bool,
|
||||
}
|
||||
@@ -318,7 +376,13 @@ fn search_for_materials(home: &Path) -> Found {
|
||||
stack.push((path, depth + 1));
|
||||
}
|
||||
} else if kind.is_file() {
|
||||
if name_text == GDK_MARKER {
|
||||
if name_text == GHIDRA_REPORT {
|
||||
if let Some(dir) = path.parent()
|
||||
&& ghidra_programs(dir).is_some()
|
||||
{
|
||||
found.ghidra_results.push(dir.to_path_buf());
|
||||
}
|
||||
} else if name_text == GDK_MARKER {
|
||||
if let Some(root) = gdk_root_for(home, &path)
|
||||
&& !found.gdk_roots.contains(&root)
|
||||
&& check_gdk_root(root.to_str()).is_ok()
|
||||
@@ -335,6 +399,7 @@ fn search_for_materials(home: &Path) -> Found {
|
||||
}
|
||||
found.gdk_roots.sort();
|
||||
found.target_exes.sort();
|
||||
found.ghidra_results.sort();
|
||||
// The GDK ships tools that import the same library; they are not titles.
|
||||
let roots = found.gdk_roots.clone();
|
||||
found
|
||||
@@ -409,7 +474,12 @@ fn distinct_builds_by(candidates: Vec<PathBuf>, siblings: impl Fn(&Path) -> usiz
|
||||
fn find_materials(config: &mut BTreeMap<String, String>) -> bool {
|
||||
let need_target = check_target_exe(config.get(TARGET_EXE_KEY).map(String::as_str)).is_err();
|
||||
let need_gdk = check_gdk_root(config.get(GDK_ROOT_KEY).map(String::as_str)).is_err();
|
||||
if !need_target && !need_gdk {
|
||||
let need_ghidra = check_ghidra_for_target(
|
||||
config.get(GHIDRA_RESULTS_KEY).map(String::as_str),
|
||||
config.get(TARGET_EXE_KEY).map(String::as_str),
|
||||
)
|
||||
.is_err();
|
||||
if !need_target && !need_gdk && !need_ghidra {
|
||||
return false;
|
||||
}
|
||||
let Some(home) = env::var_os("HOME").map(PathBuf::from) else {
|
||||
@@ -417,7 +487,7 @@ fn find_materials(config: &mut BTreeMap<String, String>) -> bool {
|
||||
return false;
|
||||
};
|
||||
println!(
|
||||
"Searching the home folder for the GDK and the target build (this can take a minute)..."
|
||||
"Searching the home folder for the GDK, the target build and its Ghidra results (this can take a minute)..."
|
||||
);
|
||||
let found = search_for_materials(&home);
|
||||
let mut changed = false;
|
||||
@@ -453,6 +523,30 @@ fn find_materials(config: &mut BTreeMap<String, String>) -> bool {
|
||||
}
|
||||
}
|
||||
}
|
||||
if need_ghidra {
|
||||
// Results are only useful for the build being worked on: the first that covers it.
|
||||
let target = config.get(TARGET_EXE_KEY).map(PathBuf::from);
|
||||
let covering = target
|
||||
.as_deref()
|
||||
.and_then(|t| found.ghidra_results.iter().find(|r| ghidra_covers(r, t)));
|
||||
match (covering, target.is_some(), found.ghidra_results.is_empty()) {
|
||||
(Some(results), _, _) => {
|
||||
config.insert(
|
||||
GHIDRA_RESULTS_KEY.to_owned(),
|
||||
results.to_string_lossy().into_owned(),
|
||||
);
|
||||
changed = true;
|
||||
println!(" Ghidra results: found and saved");
|
||||
}
|
||||
(None, false, _) => {
|
||||
println!(" Ghidra results: set the target build first, then run --find again")
|
||||
}
|
||||
(None, true, true) => println!(" Ghidra results: not found in the home folder"),
|
||||
(None, true, false) => {
|
||||
println!(" Ghidra results: found, but none covers the target build")
|
||||
}
|
||||
}
|
||||
}
|
||||
if found.truncated {
|
||||
println!(" (the search stopped early: the home folder has too many entries)");
|
||||
}
|
||||
@@ -480,6 +574,7 @@ fn cmd_setup(args: &[String]) -> ExitCode {
|
||||
let (key, check): (&str, SettingCheck) = match args[i].as_str() {
|
||||
"--target-exe" => (TARGET_EXE_KEY, check_target_exe),
|
||||
"--gdk-root" => (GDK_ROOT_KEY, check_gdk_root),
|
||||
"--ghidra-results" => (GHIDRA_RESULTS_KEY, check_ghidra_results),
|
||||
other => {
|
||||
eprintln!("error: unknown argument: {other}");
|
||||
return ExitCode::FAILURE;
|
||||
@@ -520,6 +615,10 @@ fn cmd_setup(args: &[String]) -> ExitCode {
|
||||
state(TARGET_EXE_KEY, check_target_exe)
|
||||
);
|
||||
println!(" GDK : {}", state(GDK_ROOT_KEY, check_gdk_root));
|
||||
println!(
|
||||
" Ghidra results: {}",
|
||||
state(GHIDRA_RESULTS_KEY, check_ghidra_results)
|
||||
);
|
||||
println!("They are kept outside the repository. Run `bx-cli preflight` to check everything.");
|
||||
ExitCode::SUCCESS
|
||||
}
|
||||
@@ -538,6 +637,33 @@ fn check_target_exe(value: Option<&str>) -> Result<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
/// The Ghidra results: the setting must be a results folder (see [`ghidra_programs`]).
|
||||
fn check_ghidra_results(value: Option<&str>) -> Result<String, String> {
|
||||
let root = value.filter(|v| !v.is_empty()).ok_or(
|
||||
"not set; run `bx-cli setup --find`, or `bx-cli setup --ghidra-results <folder with RUN_REPORT.md, exports/ and decompiled/>`",
|
||||
)?;
|
||||
match ghidra_programs(Path::new(root)) {
|
||||
Some(programs) => Ok(format!("present ({} programs analysed)", programs.len())),
|
||||
None => Err("that folder is not a Ghidra results folder (RUN_REPORT.md, exports/*/manifest.json, decompiled/)".to_owned()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Preflight's view of the Ghidra results: present, and covering the configured target build.
|
||||
fn check_ghidra_for_target(results: Option<&str>, target: Option<&str>) -> Result<String, String> {
|
||||
let found = check_ghidra_results(results)?;
|
||||
match target.filter(|t| !t.is_empty()) {
|
||||
Some(target)
|
||||
if ghidra_covers(Path::new(results.unwrap_or_default()), Path::new(target)) =>
|
||||
{
|
||||
Ok(found)
|
||||
}
|
||||
Some(_) => {
|
||||
Err("the results do not cover the configured target build's executable".to_owned())
|
||||
}
|
||||
None => Err("cannot be matched: the target build is not set".to_owned()),
|
||||
}
|
||||
}
|
||||
|
||||
/// The GDK: the setting must be a folder that contains the GDK's `d3d12_xs.h`.
|
||||
fn check_gdk_root(value: Option<&str>) -> Result<String, String> {
|
||||
let root = value
|
||||
@@ -588,7 +714,7 @@ fn render_preflight(requirements: &[Requirement]) -> (String, bool) {
|
||||
"Ready to work.\n"
|
||||
} else {
|
||||
"Not ready. Fix what you can yourself (AGENTS.md section 0, step 1): `bx-cli setup --find` for the \
|
||||
target build and the GDK, Homebrew for missing tools, your own scratch files for disk space. \
|
||||
target build, the GDK and the Ghidra results, Homebrew for missing tools, your own scratch files for disk space. \
|
||||
Stop only for what is not on this machine.\n"
|
||||
});
|
||||
(out, ready)
|
||||
@@ -650,6 +776,13 @@ fn cmd_preflight() -> ExitCode {
|
||||
"GDK",
|
||||
check_gdk_root(local_setting("BX_GDK_ROOT", GDK_ROOT_KEY, &config).as_deref()),
|
||||
),
|
||||
(
|
||||
"Ghidra results",
|
||||
check_ghidra_for_target(
|
||||
local_setting("BX_GHIDRA_RESULTS", GHIDRA_RESULTS_KEY, &config).as_deref(),
|
||||
local_setting("BX_TARGET_EXE", TARGET_EXE_KEY, &config).as_deref(),
|
||||
),
|
||||
),
|
||||
(
|
||||
"Free disk space",
|
||||
match free {
|
||||
@@ -1045,6 +1178,9 @@ struct RunArgs {
|
||||
inherit_env: bool,
|
||||
timeout: Option<Duration>,
|
||||
backend: Option<String>,
|
||||
/// The GDK's texture libraries (gdk_libs): `Some` when asked for or refused, `None` to use
|
||||
/// them only for the configured target build.
|
||||
gdk_libraries: Option<bool>,
|
||||
}
|
||||
|
||||
fn parse_run_args(args: &[String]) -> Result<RunArgs, String> {
|
||||
@@ -1057,6 +1193,7 @@ fn parse_run_args(args: &[String]) -> Result<RunArgs, String> {
|
||||
let mut inherit_env = false;
|
||||
let mut timeout = None;
|
||||
let mut backend: Option<String> = None;
|
||||
let mut gdk_libraries: Option<bool> = None;
|
||||
|
||||
let mut i = 0;
|
||||
while i < args.len() {
|
||||
@@ -1070,7 +1207,15 @@ fn parse_run_args(args: &[String]) -> Result<RunArgs, String> {
|
||||
i += 2;
|
||||
}
|
||||
"--profile" if i + 1 < args.len() => {
|
||||
profile = args[i + 1].clone();
|
||||
let name = args[i + 1].to_ascii_lowercase();
|
||||
if !PROFILES.contains(&name.as_str()) {
|
||||
return Err(format!(
|
||||
"unknown profile {:?}; use one of {}",
|
||||
args[i + 1],
|
||||
PROFILES.join(", ")
|
||||
));
|
||||
}
|
||||
profile = name;
|
||||
i += 2;
|
||||
}
|
||||
"--bottle" if i + 1 < args.len() => {
|
||||
@@ -1109,6 +1254,14 @@ fn parse_run_args(args: &[String]) -> Result<RunArgs, String> {
|
||||
inherit_env = true;
|
||||
i += 1;
|
||||
}
|
||||
"--gdk-libraries" => {
|
||||
gdk_libraries = Some(true);
|
||||
i += 1;
|
||||
}
|
||||
"--no-gdk-libraries" => {
|
||||
gdk_libraries = Some(false);
|
||||
i += 1;
|
||||
}
|
||||
other => return Err(format!("unknown argument: {other}")),
|
||||
}
|
||||
}
|
||||
@@ -1133,6 +1286,7 @@ fn parse_run_args(args: &[String]) -> Result<RunArgs, String> {
|
||||
inherit_env,
|
||||
timeout,
|
||||
backend,
|
||||
gdk_libraries,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1450,6 +1604,7 @@ fn cmd_run(args: &[String]) -> ExitCode {
|
||||
inherit_env,
|
||||
timeout,
|
||||
backend,
|
||||
gdk_libraries,
|
||||
} = run;
|
||||
|
||||
let cx_root = Path::new("/Applications/CrossOver.app/Contents/SharedSupport/CrossOver");
|
||||
@@ -1460,8 +1615,62 @@ fn cmd_run(args: &[String]) -> ExitCode {
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
|
||||
let abs_shims = fs::canonicalize(&shims_dir).unwrap_or(shims_dir);
|
||||
let mut abs_shims = fs::canonicalize(&shims_dir).unwrap_or(shims_dir);
|
||||
let abs_exe = fs::canonicalize(&exe).unwrap_or(exe);
|
||||
|
||||
// The GDK's texture libraries (gdk_libs.rs, ADR 0010): staged for the configured target
|
||||
// build, or with --gdk-libraries, from the GDK configured on this machine.
|
||||
let config = local_config_path()
|
||||
.map(|p| read_local_config(&p))
|
||||
.unwrap_or_default();
|
||||
let is_target = local_setting("BX_TARGET_EXE", TARGET_EXE_KEY, &config)
|
||||
.and_then(|t| fs::canonicalize(t).ok())
|
||||
.is_some_and(|t| t == abs_exe);
|
||||
let mut staged_bcpack: Option<PathBuf> = None;
|
||||
let mut gdk_shims_dir: Option<PathBuf> = None;
|
||||
if gdk_libraries.unwrap_or(is_target) {
|
||||
match local_setting("BX_GDK_ROOT", GDK_ROOT_KEY, &config) {
|
||||
Some(root) => {
|
||||
let libs = gdk_libs::find(Path::new(&root));
|
||||
let out = env::temp_dir().join(format!("bx-gdk-shims-{}", std::process::id()));
|
||||
match gdk_libs::merge_shims(&abs_shims, &libs, &out) {
|
||||
Ok(bcpack) => {
|
||||
diag(format_args!(
|
||||
"bx-cli: GDK texture libraries: XG {}, BCPack {}",
|
||||
if libs.xg.is_some() {
|
||||
"staged"
|
||||
} else {
|
||||
"not found"
|
||||
},
|
||||
if bcpack.is_some() {
|
||||
"staged"
|
||||
} else {
|
||||
"not found"
|
||||
}
|
||||
));
|
||||
staged_bcpack = bcpack;
|
||||
abs_shims = out.clone();
|
||||
gdk_shims_dir = Some(out);
|
||||
}
|
||||
Err(e) => diag(format_args!(
|
||||
"warning: GDK texture libraries not staged: {e}"
|
||||
)),
|
||||
}
|
||||
}
|
||||
None => diag(
|
||||
"warning: GDK texture libraries not staged: no GDK configured (bx-cli setup --find)",
|
||||
),
|
||||
}
|
||||
}
|
||||
struct RemoveOnDrop(Option<PathBuf>);
|
||||
impl Drop for RemoveOnDrop {
|
||||
fn drop(&mut self) {
|
||||
if let Some(dir) = &self.0 {
|
||||
let _ = fs::remove_dir_all(dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
let _gdk_shims_cleanup = RemoveOnDrop(gdk_shims_dir);
|
||||
let wine_shims_path = unix_to_wine_z_path(&abs_shims);
|
||||
|
||||
let resolved_prefix =
|
||||
@@ -1575,30 +1784,89 @@ fn cmd_run(args: &[String]) -> ExitCode {
|
||||
None => diag("warning: Xbox drive G: not mapped: the executable has no parent directory"),
|
||||
}
|
||||
|
||||
let mut cmd = if let Some(ref bname) = bottle {
|
||||
let mut c = Command::new(&wine_wrapper);
|
||||
c.args(["--bottle", bname])
|
||||
.args(bottle_options(backend.as_deref()))
|
||||
.arg(&abs_exe);
|
||||
c
|
||||
} else {
|
||||
let _ = fs::create_dir_all(&resolved_prefix);
|
||||
let mut c = Command::new(&wineloader);
|
||||
c.arg(&abs_exe);
|
||||
c
|
||||
let guest_command = || {
|
||||
let mut command = if let Some(ref bname) = bottle {
|
||||
let mut command = Command::new(&wine_wrapper);
|
||||
command
|
||||
.args(["--bottle", bname])
|
||||
.args(bottle_options(backend.as_deref()));
|
||||
command
|
||||
} else {
|
||||
Command::new(&wineloader)
|
||||
};
|
||||
apply_host_env(&mut command, inherit_env);
|
||||
if bottle.is_none() {
|
||||
apply_prefix_env(&mut command, cx_root, &resolved_prefix, &wineloader);
|
||||
}
|
||||
command.env("WINEDEBUG", "-all");
|
||||
command
|
||||
};
|
||||
|
||||
apply_host_env(&mut cmd, inherit_env);
|
||||
|
||||
if bottle.is_none() {
|
||||
apply_prefix_env(&mut cmd, cx_root, &resolved_prefix, &wineloader);
|
||||
if staged_names.iter().any(|name| name == "bx_runtime_veh.dll") {
|
||||
// This title reads the console profile before it calls any shim entry point.
|
||||
// Publish the same profile as XSystemGetDeviceType while the prefix is locked.
|
||||
let mode = if profile == "anaconda" {
|
||||
"0x64"
|
||||
} else {
|
||||
"0x60"
|
||||
};
|
||||
let mut registry = guest_command();
|
||||
registry
|
||||
.args([
|
||||
"reg.exe",
|
||||
"add",
|
||||
r"HKLM\Software\Microsoft\Windows NT\CurrentVersion\OEM",
|
||||
"/v",
|
||||
"ConsoleMode",
|
||||
"/t",
|
||||
"REG_DWORD",
|
||||
"/d",
|
||||
mode,
|
||||
"/f",
|
||||
])
|
||||
.stdout(Stdio::null());
|
||||
let active = active_time(started.elapsed(), supervise::suspended_time());
|
||||
let remaining = match guest_time_left(timeout, active) {
|
||||
Ok(remaining) => remaining,
|
||||
Err(e) => {
|
||||
diag(format_args!("timed out before setting ConsoleMode: {e}"));
|
||||
return ExitCode::from(124);
|
||||
}
|
||||
};
|
||||
match supervise::supervise(registry, remaining, supervise::received_signal) {
|
||||
Ok(Outcome::Exited(status)) if status.success() => {
|
||||
diag(format_args!("bx-cli: ConsoleMode={mode} profile={profile}"));
|
||||
}
|
||||
Ok(Outcome::Exited(status)) => {
|
||||
diag(format_args!("warning: could not set ConsoleMode: {status}"));
|
||||
}
|
||||
Ok(outcome @ Outcome::Stopped(stop)) => {
|
||||
let failed = stop_environment(
|
||||
stop,
|
||||
cx_root,
|
||||
&environment_dir,
|
||||
bottle.as_deref(),
|
||||
inherit_env,
|
||||
);
|
||||
let code = outcome.exit_code();
|
||||
return ExitCode::from(if failed { code.max(1) } else { code });
|
||||
}
|
||||
Err(e) => diag(format_args!("warning: could not set ConsoleMode: {e}")),
|
||||
}
|
||||
}
|
||||
|
||||
if bottle.is_none() {
|
||||
let _ = fs::create_dir_all(&resolved_prefix);
|
||||
}
|
||||
let mut cmd = guest_command();
|
||||
cmd.arg(&abs_exe);
|
||||
cmd.env("ROSETTA_ADVERTISE_AVX", "1")
|
||||
.env("WINEDLLOVERRIDES", SHIM_DLL_OVERRIDES)
|
||||
.env("WINEPATH", &wine_shims_path)
|
||||
.env("BX_PROFILE", &profile)
|
||||
.env("WINEDEBUG", "-all");
|
||||
.env("BX_PROFILE", &profile);
|
||||
if let Some(bcpack) = &staged_bcpack {
|
||||
cmd.env("BX_BCPACK_DLL", unix_to_wine_z_path(bcpack));
|
||||
}
|
||||
|
||||
let abs_log = log_file.map(|lf| {
|
||||
if lf.is_absolute() {
|
||||
@@ -2111,12 +2379,16 @@ mod tests {
|
||||
assert_eq!(run.backend.as_deref(), Some("d3dmetal"));
|
||||
assert_eq!(run.shims_dir, PathBuf::from("build-shims/bin"));
|
||||
assert_eq!(run.profile, "lockhart");
|
||||
// ConsoleMode and BX_PROFILE must name the same console whatever the case.
|
||||
let mixed = parse_run_args(&args(&["--exe", "a.exe", "--profile", "Anaconda"])).unwrap();
|
||||
assert_eq!(mixed.profile, "anaconda");
|
||||
let plain = parse_run_args(&args(&["--exe", "a.exe"])).unwrap();
|
||||
assert!(plain.timeout.is_none() && plain.bottle.is_none() && plain.prefix.is_none());
|
||||
for bad in [
|
||||
&["--exe", "a.exe", "--timeout", "0"][..],
|
||||
&["--exe", "a.exe", "--timeout", "soon"],
|
||||
&["--exe", "a.exe", "--backend", "dmxt2"],
|
||||
&["--exe", "a.exe", "--profile", "scarlett"],
|
||||
&["--exe", "a.exe", "--bottle", "../x"],
|
||||
&["--exe", "a.exe", "--timeout"],
|
||||
&["--bottle", "b"],
|
||||
@@ -2592,6 +2864,44 @@ sub setup_bottle_wineprefix {
|
||||
fs::write(dir.join("a/b/include").join(GDK_MARKER), b"// header").unwrap();
|
||||
assert!(check_gdk_root(dir.to_str()).unwrap().contains("found"));
|
||||
|
||||
// Ghidra results: unset, not a results folder, results for another program, results
|
||||
// covering the target build (matched by its file name, whatever the case).
|
||||
assert!(check_ghidra_results(None).unwrap_err().contains("not set"));
|
||||
let results = dir.join("results");
|
||||
fs::create_dir_all(results.join("exports/other")).unwrap();
|
||||
assert!(
|
||||
check_ghidra_results(results.to_str())
|
||||
.unwrap_err()
|
||||
.contains("not a Ghidra results folder")
|
||||
);
|
||||
fs::create_dir_all(results.join("decompiled")).unwrap();
|
||||
fs::write(results.join(GHIDRA_REPORT), b"# RUN_REPORT").unwrap();
|
||||
fs::write(results.join("exports/other/functions.csv"), b"").unwrap();
|
||||
fs::write(
|
||||
results.join("exports/other/manifest.json"),
|
||||
br#"{"program": "other.dll", "rows": {}}"#,
|
||||
)
|
||||
.unwrap();
|
||||
assert!(check_ghidra_results(results.to_str()).is_ok());
|
||||
assert!(
|
||||
check_ghidra_for_target(results.to_str(), pe.to_str())
|
||||
.unwrap_err()
|
||||
.contains("do not cover")
|
||||
);
|
||||
assert!(
|
||||
check_ghidra_for_target(results.to_str(), None)
|
||||
.unwrap_err()
|
||||
.contains("target build is not set")
|
||||
);
|
||||
fs::create_dir_all(results.join("exports/t")).unwrap();
|
||||
fs::write(results.join("exports/t/functions.csv"), b"").unwrap();
|
||||
fs::write(
|
||||
results.join("exports/t/manifest.json"),
|
||||
br#"{"program":"TITLE.exe"}"#,
|
||||
)
|
||||
.unwrap();
|
||||
assert!(check_ghidra_for_target(results.to_str(), pe.to_str()).is_ok());
|
||||
|
||||
// One missing requirement makes the whole preflight not ready, and says so.
|
||||
let (text, ready) = render_preflight(&[
|
||||
("Target build", Ok("present".to_owned())),
|
||||
|
||||
@@ -8,6 +8,7 @@ bx_add_shim_dll(d3d12_xs d3d12_xs d3d12_xs.def
|
||||
xbox_facade.cpp
|
||||
frame_pacing.cpp
|
||||
placed_x.cpp
|
||||
gdk_xg.cpp
|
||||
descriptor_heaps.cpp
|
||||
committed.cpp
|
||||
console_formats.cpp
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
|
||||
#include "console_formats.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
extern "C" __declspec(dllimport) PVOID WINAPI XMemAlloc(SIZE_T size, ULONGLONG attributes);
|
||||
|
||||
@@ -175,4 +177,29 @@ HRESULT STDMETHODCALLTYPE bx_xbox_device_create_committed_resource3(void* self,
|
||||
riid, ppv, "CreateCommittedResource3", title_format);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE bx_xbox_device_create_committed_resource_x(void* self, const D3D12_HEAP_PROPERTIES* heap,
|
||||
D3D12_HEAP_FLAGS flags, const void* xbox_desc,
|
||||
D3D12_RESOURCE_STATES state,
|
||||
const D3D12_CLEAR_VALUE* clear, REFIID riid,
|
||||
void** ppv) {
|
||||
BX_D3D_TRACE("XboxDevice", "CreateCommittedResourceX");
|
||||
if (!xbox_desc) return E_INVALIDARG;
|
||||
// D3D12XBOX_RESOURCE_DESC begins with the PC description; DccOptions follows it. DccOptions is
|
||||
// a struct of two 32-bit enums, CompressionLevel and ColorTransform; every value of either
|
||||
// selects some form of colour compression (CompressionLevel 0 is 64B, not "none").
|
||||
D3D12_RESOURCE_DESC desc{};
|
||||
std::memcpy(&desc, xbox_desc, sizeof(desc));
|
||||
UINT32 dcc[2] = {};
|
||||
std::memcpy(dcc, static_cast<const char*>(xbox_desc) + sizeof(desc), sizeof(dcc));
|
||||
static std::atomic<UINT> logged{0};
|
||||
if (logged.fetch_add(1) < 8) {
|
||||
char detail[128];
|
||||
std::snprintf(detail, sizeof(detail),
|
||||
"DccOptions CompressionLevel=%u ColorTransform=%u ignored (no colour compression on the host)",
|
||||
dcc[0], dcc[1]);
|
||||
bx_log_emit(BX_LOG_INFO, "d3d12_xs", "CreateCommittedResourceX", detail);
|
||||
}
|
||||
return bx_xbox_device_create_committed_resource(self, heap, flags, &desc, state, clear, riid, ppv);
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "console_formats.h"
|
||||
|
||||
#include "xbox_facade.h"
|
||||
#include "gdk_xg.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdio>
|
||||
@@ -74,6 +75,68 @@ private:
|
||||
std::vector<Desc> copy_;
|
||||
};
|
||||
|
||||
D3D12_RESOURCE_DESC as_desc(const D3D12_RESOURCE_DESC& d) { return d; }
|
||||
D3D12_RESOURCE_DESC as_desc(const D3D12_RESOURCE_DESC1& d) {
|
||||
D3D12_RESOURCE_DESC out{};
|
||||
out.Dimension = d.Dimension;
|
||||
out.Alignment = d.Alignment;
|
||||
out.Width = d.Width;
|
||||
out.Height = d.Height;
|
||||
out.DepthOrArraySize = d.DepthOrArraySize;
|
||||
out.MipLevels = d.MipLevels;
|
||||
out.Format = d.Format;
|
||||
out.SampleDesc = d.SampleDesc;
|
||||
out.Layout = d.Layout;
|
||||
out.Flags = d.Flags;
|
||||
return out;
|
||||
}
|
||||
|
||||
/* Allocation info for descriptions that include a console texture layout. The console sizes come
|
||||
from the GDK's XG (gdk_xg.h); other descriptions keep the host's answer, one at a time. The
|
||||
total follows Direct3D 12: each resource at its alignment, in order; the total alignment is the
|
||||
largest. Returns false (the host answers everything) when no description has a console layout
|
||||
or XG is not loaded. */
|
||||
template <typename Desc>
|
||||
bool console_allocation(ID3D12Device* device, UINT mask, UINT count, const Desc* descs, D3D12_RESOURCE_ALLOCATION_INFO* total,
|
||||
D3D12_RESOURCE_ALLOCATION_INFO1* each, const char* method) {
|
||||
if (!descs || !count || !bx_gdk_xg_available()) return false;
|
||||
bool any = false;
|
||||
for (UINT i = 0; i < count && !any; ++i) any = bx_is_console_texture_layout(as_desc(descs[i]));
|
||||
if (!any) return false;
|
||||
uint64_t offset = 0, max_alignment = 0;
|
||||
for (UINT i = 0; i < count; ++i) {
|
||||
const D3D12_RESOURCE_DESC desc = as_desc(descs[i]);
|
||||
uint64_t size = 0, alignment = 0;
|
||||
if (!bx_is_console_texture_layout(desc) || !bx_gdk_xg_layout_size(desc, &size, &alignment)) {
|
||||
D3D12_RESOURCE_DESC host = desc;
|
||||
if (bx_is_console_only_format(host.Format)) host.Format = bx_host_resource_format(host.Format);
|
||||
if (bx_is_console_texture_layout(host)) host.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
|
||||
D3D12_RESOURCE_ALLOCATION_INFO one{};
|
||||
device->GetResourceAllocationInfo(&one, mask, 1, &host);
|
||||
size = one.SizeInBytes;
|
||||
alignment = one.Alignment;
|
||||
} else {
|
||||
static std::atomic<int> logged{0};
|
||||
if (logged.fetch_add(1) < 24) {
|
||||
char detail[192];
|
||||
std::snprintf(detail, sizeof(detail), "%s %llux%ux%u mips=%u format=%d layout=0x%x: console size %llu, alignment %llu",
|
||||
method, static_cast<unsigned long long>(desc.Width), desc.Height, desc.DepthOrArraySize, desc.MipLevels,
|
||||
static_cast<int>(desc.Format), static_cast<UINT>(desc.Layout), static_cast<unsigned long long>(size),
|
||||
static_cast<unsigned long long>(alignment));
|
||||
bx_log_emit(BX_LOG_INFO, "d3d12_xs", "console_allocation", detail);
|
||||
}
|
||||
}
|
||||
if (size == UINT64_MAX || !alignment) return false;
|
||||
offset = (offset + alignment - 1) / alignment * alignment;
|
||||
if (each) each[i] = D3D12_RESOURCE_ALLOCATION_INFO1{offset, alignment, size};
|
||||
offset += size;
|
||||
if (alignment > max_alignment) max_alignment = alignment;
|
||||
}
|
||||
total->SizeInBytes = offset;
|
||||
total->Alignment = max_alignment;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" {
|
||||
@@ -81,8 +144,11 @@ extern "C" {
|
||||
D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE bx_xbox_device_get_resource_allocation_info(void* self, UINT mask, UINT count,
|
||||
const D3D12_RESOURCE_DESC* descs) {
|
||||
BX_D3D_TRACE("XboxDevice", "GetResourceAllocationInfo");
|
||||
const HostDescs<D3D12_RESOURCE_DESC> host(descs, count, "GetResourceAllocationInfo");
|
||||
D3D12_RESOURCE_ALLOCATION_INFO result{};
|
||||
if (console_allocation(bx_xbox_host<ID3D12Device>(self), mask, count, descs, &result, nullptr, "GetResourceAllocationInfo")) {
|
||||
return result;
|
||||
}
|
||||
const HostDescs<D3D12_RESOURCE_DESC> host(descs, count, "GetResourceAllocationInfo");
|
||||
bx_xbox_host<ID3D12Device>(self)->GetResourceAllocationInfo(&result, mask, count, host.get());
|
||||
return result;
|
||||
}
|
||||
@@ -90,8 +156,11 @@ D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE bx_xbox_device_get_resource_all
|
||||
D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE bx_xbox_device_get_resource_allocation_info1(
|
||||
void* self, UINT mask, UINT count, const D3D12_RESOURCE_DESC* descs, D3D12_RESOURCE_ALLOCATION_INFO1* each) {
|
||||
BX_D3D_TRACE("XboxDevice", "GetResourceAllocationInfo1");
|
||||
const HostDescs<D3D12_RESOURCE_DESC> host(descs, count, "GetResourceAllocationInfo1");
|
||||
D3D12_RESOURCE_ALLOCATION_INFO result{};
|
||||
if (console_allocation(bx_xbox_host<ID3D12Device>(self), mask, count, descs, &result, each, "GetResourceAllocationInfo1")) {
|
||||
return result;
|
||||
}
|
||||
const HostDescs<D3D12_RESOURCE_DESC> host(descs, count, "GetResourceAllocationInfo1");
|
||||
bx_xbox_host<ID3D12Device4>(self)->GetResourceAllocationInfo1(&result, mask, count, host.get(), each);
|
||||
return result;
|
||||
}
|
||||
@@ -99,8 +168,11 @@ D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE bx_xbox_device_get_resource_all
|
||||
D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE bx_xbox_device_get_resource_allocation_info2(
|
||||
void* self, UINT mask, UINT count, const D3D12_RESOURCE_DESC1* descs, D3D12_RESOURCE_ALLOCATION_INFO1* each) {
|
||||
BX_D3D_TRACE("XboxDevice", "GetResourceAllocationInfo2");
|
||||
const HostDescs<D3D12_RESOURCE_DESC1> host(descs, count, "GetResourceAllocationInfo2");
|
||||
D3D12_RESOURCE_ALLOCATION_INFO result{};
|
||||
if (console_allocation(bx_xbox_host<ID3D12Device>(self), mask, count, descs, &result, each, "GetResourceAllocationInfo2")) {
|
||||
return result;
|
||||
}
|
||||
const HostDescs<D3D12_RESOURCE_DESC1> host(descs, count, "GetResourceAllocationInfo2");
|
||||
bx_xbox_host<ID3D12Device8>(self)->GetResourceAllocationInfo2(&result, mask, count, host.get(), each);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,12 @@ extern "C" {
|
||||
* models (or one the host device answers); anything else fails with E_NOINTERFACE and a logged
|
||||
* IID.
|
||||
*/
|
||||
extern "C" void bx_gdk_xg_enable_locking();
|
||||
|
||||
HRESULT WINAPI D3D12XboxCreateDevice(PVOID adapter, const void* params, REFIID riid, void** ppv) {
|
||||
// The title creates XG texture computers on its own threads; the shim does too (gdk_xg.h).
|
||||
static const bool xg_locking = (bx_gdk_xg_enable_locking(), true);
|
||||
(void)xg_locking;
|
||||
if (!ppv) {
|
||||
return E_POINTER;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,17 @@
|
||||
* FLIP events, and IntervalOffsetInMicroseconds later the ORIGIN event, which also produces a
|
||||
* new frame pipeline token. Each signal also sets the ancillary events given to
|
||||
* ScheduleFrameEventX. Timing follows the host's Sleep granularity; no display is involved.
|
||||
*
|
||||
* GetFrameStatisticsX (authorized GDK documentation) answers from a history of the last 17
|
||||
* frames, kept per pipeline token: the ORIGIN event (wait call, signal and wait return times)
|
||||
* and PresentX (call and return times), in QueryPerformanceCounter ticks as documented. The
|
||||
* other statistics types (interval, power scaling, render, display, input) have no host source
|
||||
* and are never reported; a query for only those answers S_FALSE, "not available yet".
|
||||
*/
|
||||
#include "xbox_facade.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
@@ -43,6 +50,35 @@ UINT64 g_next_token = 1;
|
||||
UINT64 g_last_origin_token = 0;
|
||||
bool g_thread_started = false;
|
||||
|
||||
// Frame statistics history (GetFrameStatisticsX): the runtime keeps the last 17 frames.
|
||||
constexpr UINT kHistory = 17;
|
||||
struct FrameRecord {
|
||||
UINT64 token = 0;
|
||||
UINT64 wait_call = 0, signal = 0, wait_return = 0;
|
||||
UINT offset_us = 0;
|
||||
bool signaled = false;
|
||||
bool waited = false;
|
||||
bool presented = false;
|
||||
UINT64 present_call = 0, present_return = 0;
|
||||
};
|
||||
FrameRecord g_history[kHistory];
|
||||
|
||||
UINT64 qpc_now() {
|
||||
LARGE_INTEGER t;
|
||||
QueryPerformanceCounter(&t);
|
||||
return static_cast<UINT64>(t.QuadPart);
|
||||
}
|
||||
|
||||
// The record for `token`, created when `create` (replacing the one 17 frames older); else null.
|
||||
FrameRecord* record_for(UINT64 token, bool create) {
|
||||
FrameRecord& r = g_history[token % kHistory];
|
||||
if (r.token == token) return &r;
|
||||
if (!create) return nullptr;
|
||||
r = FrameRecord{};
|
||||
r.token = token;
|
||||
return &r;
|
||||
}
|
||||
|
||||
void close_ancillary(Scheduled& e) {
|
||||
for (UINT i = 0; i < e.ancillary_count; ++i) CloseHandle(e.ancillary[i]);
|
||||
e.ancillary_count = 0;
|
||||
@@ -52,7 +88,13 @@ void signal(UINT type) {
|
||||
std::lock_guard<std::mutex> guard(g_lock);
|
||||
const Scheduled& e = g_events[type];
|
||||
if (!e.active) return;
|
||||
if (type == kOrigin) g_last_origin_token = g_next_token++;
|
||||
if (type == kOrigin) {
|
||||
g_last_origin_token = g_next_token++;
|
||||
FrameRecord* r = record_for(g_last_origin_token, true);
|
||||
r->signal = qpc_now();
|
||||
r->offset_us = e.offset_us;
|
||||
r->signaled = true;
|
||||
}
|
||||
SetEvent(g_signal[type]);
|
||||
for (UINT i = 0; i < e.ancillary_count; ++i) SetEvent(e.ancillary[i]);
|
||||
}
|
||||
@@ -156,6 +198,7 @@ HRESULT STDMETHODCALLTYPE bx_xbox_device_wait_frame_event_x(void*, UINT type, UI
|
||||
}
|
||||
const UINT ancillary = waits ? waits->Count : 0;
|
||||
for (UINT i = 0; i < ancillary; ++i) handles[1 + i] = waits->pObjects[i];
|
||||
const UINT64 wait_call = qpc_now();
|
||||
const DWORD result = WaitForMultipleObjects(1 + ancillary, handles, (flags & kWaitAll) != 0,
|
||||
timeout_ms == kInfinite ? INFINITE : timeout_ms);
|
||||
const bool satisfied = result < WAIT_OBJECT_0 + 1 + ancillary;
|
||||
@@ -166,8 +209,68 @@ HRESULT STDMETHODCALLTYPE bx_xbox_device_wait_frame_event_x(void*, UINT type, UI
|
||||
if (type == kOrigin && token && (satisfied || (flags & kWaitProcessTokenOnTimeout))) {
|
||||
std::lock_guard<std::mutex> guard(g_lock);
|
||||
*token = satisfied ? g_last_origin_token : g_next_token++;
|
||||
if (FrameRecord* r = record_for(*token, true)) {
|
||||
r->wait_call = wait_call;
|
||||
r->wait_return = qpc_now();
|
||||
r->waited = true;
|
||||
}
|
||||
}
|
||||
return satisfied ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
void bx_xbox_frame_stats_present(UINT64 token, UINT64 call_time, UINT64 return_time) {
|
||||
if (!token) return;
|
||||
std::lock_guard<std::mutex> guard(g_lock);
|
||||
if (FrameRecord* r = record_for(token, false)) {
|
||||
r->presented = true;
|
||||
r->present_call = call_time;
|
||||
r->present_return = return_time;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE bx_xbox_device_get_frame_statistics_x(void*, UINT64 token, UINT type_set, UINT* count,
|
||||
void* statistics) {
|
||||
BX_D3D_TRACE("XboxDevice", "GetFrameStatisticsX");
|
||||
if (!count || type_set == 0 || (type_set & ~kStatsKnownTypes) != 0 || (*count && !statistics)) return E_INVALIDARG;
|
||||
BxXboxFrameStatistics found[2];
|
||||
UINT n = 0;
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(g_lock);
|
||||
if (token == 0 || token >= g_next_token) return E_INVALIDARG; // documented: unknown pipeline token
|
||||
if (const FrameRecord* r = record_for(token, false)) {
|
||||
if ((type_set & kStatsFrameEvent) && (r->signaled || r->waited)) {
|
||||
BxXboxFrameStatistics& out = found[n++];
|
||||
std::memset(&out, 0, sizeof(out));
|
||||
out.Type = kStatsFrameEvent;
|
||||
out.Event.EventType = kOrigin;
|
||||
out.Event.WaitCallTime = r->wait_call;
|
||||
out.Event.SignalTime = r->signal;
|
||||
out.Event.WaitReturnTime = r->wait_return;
|
||||
out.Event.IntervalOffsetInMicroseconds = r->offset_us;
|
||||
out.Event.StatisticsFlags = r->signaled ? 0 : kEventSignalPending;
|
||||
}
|
||||
if ((type_set & kStatsPresent) && r->presented) {
|
||||
BxXboxFrameStatistics& out = found[n++];
|
||||
std::memset(&out, 0, sizeof(out));
|
||||
out.Type = kStatsPresent;
|
||||
out.Present.PlaneIndex = 0;
|
||||
out.Present.PlaneCount = 1;
|
||||
out.Present.ViewCount = 1;
|
||||
out.Present.PresentCallTime = r->present_call;
|
||||
out.Present.PresentQueueTime = r->present_call; // queued in the call itself
|
||||
out.Present.PresentReturnTime = r->present_return;
|
||||
out.Present.PlaneSwapMask = 1; // GPUProcessTime: not measured, 0
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!statistics) { // a size query
|
||||
*count = n;
|
||||
return n ? S_OK : S_FALSE;
|
||||
}
|
||||
const UINT written = n < *count ? n : *count;
|
||||
std::memcpy(statistics, found, written * sizeof(BxXboxFrameStatistics));
|
||||
*count = written;
|
||||
return n ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
@@ -0,0 +1,94 @@
|
||||
/* Console texture layouts through the GDK's own XG library (see gdk_xg.h).
|
||||
*
|
||||
* The documented interface (GDK xg_xs.h):
|
||||
* HRESULT XGCreateTextureComputer(const XG_RESOURCE_DESC*, XGTextureAddressComputer**);
|
||||
* XG_RESOURCE_DESC has the field order and sizes of D3D12_RESOURCE_DESC, with
|
||||
* XG12_RESOURCE_MISC_FLAG in place of D3D12_RESOURCE_FLAGS; the title's console flags
|
||||
* (render target, depth, UAV, deny-compression) are those values.
|
||||
* XGTextureAddressComputer vtable: 0 AddRef, 1 Release, 2 GetResourceLayout,
|
||||
* 3 GetResourceSizeBytes, 4 GetResourceBaseAlignmentBytes, ...
|
||||
* void XGEnableExclusiveLocking(BOOL), to be called before any computer is created.
|
||||
*/
|
||||
#include "gdk_xg.h"
|
||||
|
||||
#include "bx_log.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdio>
|
||||
|
||||
namespace {
|
||||
|
||||
struct XgComputer;
|
||||
struct XgComputerVtbl {
|
||||
ULONG(__cdecl* AddRef)(XgComputer*);
|
||||
ULONG(__cdecl* Release)(XgComputer*);
|
||||
void* GetResourceLayout;
|
||||
UINT64 (*GetResourceSizeBytes)(XgComputer*);
|
||||
UINT64 (*GetResourceBaseAlignmentBytes)(XgComputer*);
|
||||
};
|
||||
struct XgComputer {
|
||||
const XgComputerVtbl* vtbl;
|
||||
};
|
||||
using CreateTextureComputerFn = HRESULT(__cdecl*)(const D3D12_RESOURCE_DESC*, XgComputer**);
|
||||
using EnableLockingFn = void(__cdecl*)(BOOL);
|
||||
|
||||
HMODULE microsoft_xg() {
|
||||
static const HMODULE module = [] {
|
||||
HMODULE xg = GetModuleHandleW(L"xg_xs.dll");
|
||||
if (!xg) xg = LoadLibraryW(L"xg_xs.dll");
|
||||
const bool microsoft = xg && GetProcAddress(xg, "XGComputeTexture2DLayout");
|
||||
bx_log_emit(microsoft ? BX_LOG_INFO : BX_LOG_WARN, "d3d12_xs", "gdk_xg",
|
||||
microsoft ? "GDK XG library loaded: console texture layouts are computed by it"
|
||||
: "GDK XG library not loaded: console textures are sized linearly (bx-cli run stages it "
|
||||
"from the configured GDK)");
|
||||
return microsoft ? xg : static_cast<HMODULE>(nullptr);
|
||||
}();
|
||||
return module;
|
||||
}
|
||||
|
||||
CreateTextureComputerFn create_computer() {
|
||||
static const CreateTextureComputerFn fn = [] {
|
||||
HMODULE xg = microsoft_xg();
|
||||
return xg ? reinterpret_cast<CreateTextureComputerFn>(reinterpret_cast<void*>(GetProcAddress(xg, "XGCreateTextureComputer")))
|
||||
: nullptr;
|
||||
}();
|
||||
return fn;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool bx_gdk_xg_available() { return create_computer() != nullptr; }
|
||||
|
||||
bool bx_is_console_texture_layout(const D3D12_RESOURCE_DESC& desc) {
|
||||
return desc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER && desc.Dimension != D3D12_RESOURCE_DIMENSION_UNKNOWN &&
|
||||
static_cast<UINT>(desc.Layout) >= 0x100;
|
||||
}
|
||||
|
||||
bool bx_gdk_xg_layout_size(const D3D12_RESOURCE_DESC& desc, uint64_t* size, uint64_t* alignment) {
|
||||
const CreateTextureComputerFn create = create_computer();
|
||||
if (!create || !bx_is_console_texture_layout(desc)) return false;
|
||||
XgComputer* computer = nullptr;
|
||||
const HRESULT hr = create(&desc, &computer);
|
||||
if (FAILED(hr) || !computer) {
|
||||
static std::atomic<int> logged{0};
|
||||
if (logged.fetch_add(1) < 8) {
|
||||
char detail[160];
|
||||
std::snprintf(detail, sizeof(detail), "XGCreateTextureComputer refused %llux%u layout=0x%x format=%d: hr=0x%08lx",
|
||||
static_cast<unsigned long long>(desc.Width), desc.Height, static_cast<UINT>(desc.Layout),
|
||||
static_cast<int>(desc.Format), static_cast<unsigned long>(hr));
|
||||
bx_log_emit(BX_LOG_WARN, "d3d12_xs", "gdk_xg", detail);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*size = computer->vtbl->GetResourceSizeBytes(computer);
|
||||
*alignment = computer->vtbl->GetResourceBaseAlignmentBytes(computer);
|
||||
computer->vtbl->Release(computer);
|
||||
return true;
|
||||
}
|
||||
|
||||
extern "C" void bx_gdk_xg_enable_locking() {
|
||||
HMODULE xg = microsoft_xg();
|
||||
if (!xg) return;
|
||||
auto enable = reinterpret_cast<EnableLockingFn>(reinterpret_cast<void*>(GetProcAddress(xg, "XGEnableExclusiveLocking")));
|
||||
if (enable) enable(TRUE);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
/* Console texture layouts through the GDK's own XG library.
|
||||
*
|
||||
* Console textures are laid out in tiled swizzle modes (D3D12XBOX_TEXTURE_LAYOUT / XG_TEXTURE_LAYOUT,
|
||||
* 0x100 | XG_SWIZZLE_MODE). A title sizes its loads and placements from those layouts, so a
|
||||
* linear answer makes it read less than the tiled data it stored. The layouts are computed by
|
||||
* Microsoft's xg_xs.dll from the collaborator's own GDK, staged by `bx-cli run` in place of
|
||||
* BetterXen's xg_xs shim (which exports only the two functions titles import). Nothing from the
|
||||
* GDK is shipped. Without it these helpers report that no console layout is available.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <d3d12.h>
|
||||
#include <cstdint>
|
||||
|
||||
/* True when Microsoft's XG library is the loaded xg_xs.dll (it exports XGComputeTexture2DLayout). */
|
||||
bool bx_gdk_xg_available();
|
||||
|
||||
/* A console texture layout (Layout >= 0x100) that the GDK's XG can describe. */
|
||||
bool bx_is_console_texture_layout(const D3D12_RESOURCE_DESC& desc);
|
||||
|
||||
/* Size and base alignment of `desc` in the console layout. False when XG is not available or
|
||||
refuses the description; `size` and `alignment` are then untouched. */
|
||||
bool bx_gdk_xg_layout_size(const D3D12_RESOURCE_DESC& desc, uint64_t* size, uint64_t* alignment);
|
||||
|
||||
/* Enables XG's internal lock (XGEnableExclusiveLocking) before any texture computer is created,
|
||||
so the title's threads and the shim can both create computers. Called at device creation. */
|
||||
extern "C" void bx_gdk_xg_enable_locking();
|
||||
@@ -281,6 +281,21 @@ extern "C" HRESULT STDMETHODCALLTYPE bx_xbox_queue_present_x(void* self, UINT pl
|
||||
const void* parameters) {
|
||||
BX_D3D_TRACE("XboxCommandQueue", "PresentX");
|
||||
(void)parameters;
|
||||
// Call and return times for GetFrameStatisticsX, kept for the first plane's pipeline token.
|
||||
struct PresentTimes {
|
||||
UINT64 token;
|
||||
UINT64 call;
|
||||
~PresentTimes() {
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
bx_xbox_frame_stats_present(token, call, static_cast<UINT64>(now.QuadPart));
|
||||
}
|
||||
} times{plane_count && planes_raw ? static_cast<const PlaneParameters*>(planes_raw)[0].Token : 0, 0};
|
||||
{
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
times.call = static_cast<UINT64>(now.QuadPart);
|
||||
}
|
||||
const auto* planes = static_cast<const PlaneParameters*>(planes_raw);
|
||||
if (plane_count == 0 || !planes || planes[0].ResourceCount == 0 || !planes[0].ppResources) return S_OK;
|
||||
ID3D12Resource* source = bx_xbox_unwrap_as(planes[0].ppResources[0]);
|
||||
|
||||
@@ -54,6 +54,8 @@ CUSTOM = {
|
||||
"WaitFrameEventX": "bx_xbox_device_wait_frame_event_x",
|
||||
"CreatePlacedResourceX": "bx_xbox_device_create_placed_resource_x",
|
||||
"CreatePlacedResourceX1": "bx_xbox_device_create_placed_resource_x1",
|
||||
"GetFrameStatisticsX": "bx_xbox_device_get_frame_statistics_x",
|
||||
"CreateCommittedResourceX": "bx_xbox_device_create_committed_resource_x",
|
||||
"CreateDescriptorHeap": "bx_xbox_device_create_descriptor_heap",
|
||||
"GetDescriptorHandleIncrementSize": "bx_xbox_device_get_descriptor_handle_increment_size",
|
||||
"CreateConstantBufferView": "bx_xbox_device_create_constant_buffer_view",
|
||||
|
||||
@@ -154,6 +154,48 @@ struct BxXboxFrameObjectList {
|
||||
UINT Count;
|
||||
HANDLE* pObjects;
|
||||
};
|
||||
// GetFrameStatisticsX (authorized GDK header): D3D12XBOX_FRAME_STATISTICS is a 32-bit Type and,
|
||||
// 8 bytes in, a union of the per-type structures; the two this layer fills are mirrored here.
|
||||
constexpr UINT kStatsFrameEvent = 0x2, kStatsPresent = 0x1000;
|
||||
constexpr UINT kStatsKnownTypes = 0x1 | 0x2 | 0x4 | 0x100 | 0x1000 | 0x10000 | 0x100000;
|
||||
constexpr UINT kEventSignalPending = 0x1; // D3D12XBOX_FRAME_EVENT_STATISTICS_FLAG_SIGNAL_PENDING
|
||||
struct BxXboxFrameEventStatistics { // D3D12XBOX_FRAME_EVENT_STATISTICS
|
||||
UINT32 EventType;
|
||||
UINT64 WaitCallTime;
|
||||
UINT64 SignalTime;
|
||||
UINT64 WaitReturnTime;
|
||||
UINT32 IntervalOffsetInMicroseconds;
|
||||
UINT32 SignalFlags;
|
||||
UINT32 StatisticsFlags;
|
||||
};
|
||||
struct BxXboxPresentStatistics { // D3D12XBOX_PRESENT_STATISTICS
|
||||
UINT8 PlaneIndex;
|
||||
UINT8 PlaneCount;
|
||||
UINT8 ViewCount;
|
||||
UINT64 PresentCallTime;
|
||||
UINT64 PresentQueueTime;
|
||||
UINT64 PresentReturnTime;
|
||||
UINT64 GPUProcessTime;
|
||||
UINT8 QueuedFrameCount;
|
||||
UINT16 PlaneSwapMask;
|
||||
UINT32 Flags;
|
||||
};
|
||||
struct BxXboxFrameStatistics { // D3D12XBOX_FRAME_STATISTICS
|
||||
UINT32 Type;
|
||||
union {
|
||||
BxXboxFrameEventStatistics Event;
|
||||
BxXboxPresentStatistics Present;
|
||||
UINT8 Bytes[48]; // the union's size: its largest members are 48 bytes
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(BxXboxFrameEventStatistics) == 48 && sizeof(BxXboxPresentStatistics) == 48, "statistics layout");
|
||||
static_assert(sizeof(BxXboxFrameStatistics) == 56 && offsetof(BxXboxFrameStatistics, Event) == 8, "frame statistics layout");
|
||||
|
||||
HRESULT STDMETHODCALLTYPE bx_xbox_device_get_frame_statistics_x(void* self, UINT64 token, UINT type_set, UINT* count,
|
||||
void* statistics);
|
||||
// Records PresentX for its frame pipeline token (frame_pacing.cpp keeps the history).
|
||||
void bx_xbox_frame_stats_present(UINT64 token, UINT64 call_time, UINT64 return_time);
|
||||
|
||||
struct BxXboxFrameWaitList {
|
||||
UINT Count;
|
||||
HANDLE* pObjects;
|
||||
@@ -281,6 +323,14 @@ HRESULT STDMETHODCALLTYPE bx_xbox_device_register_page_pool_x(void* self, D3D12_
|
||||
HRESULT STDMETHODCALLTYPE bx_xbox_device_unregister_page_pool_x(void* self, HANDLE handle);
|
||||
|
||||
/* Committed resources with title-visible memory (committed.cpp). */
|
||||
// CreateCommittedResourceX takes D3D12XBOX_RESOURCE_DESC: the PC D3D12_RESOURCE_DESC followed by
|
||||
// DccOptions, a struct of CompressionLevel and ColorTransform (authorized GDK header). DccOptions
|
||||
// selects console colour compression, which the host does not have; it is logged and otherwise ignored.
|
||||
HRESULT STDMETHODCALLTYPE bx_xbox_device_create_committed_resource_x(void* self, const D3D12_HEAP_PROPERTIES* heap,
|
||||
D3D12_HEAP_FLAGS flags, const void* xbox_desc,
|
||||
D3D12_RESOURCE_STATES state,
|
||||
const D3D12_CLEAR_VALUE* clear, REFIID riid,
|
||||
void** ppv);
|
||||
HRESULT STDMETHODCALLTYPE bx_xbox_device_create_committed_resource(void* self, const D3D12_HEAP_PROPERTIES* heap,
|
||||
D3D12_HEAP_FLAGS flags, const D3D12_RESOURCE_DESC* desc,
|
||||
D3D12_RESOURCE_STATES state, const D3D12_CLEAR_VALUE* clear,
|
||||
|
||||
@@ -187,12 +187,8 @@ static HRESULT STDMETHODCALLTYPE x_Device_69(void*) { BX_VTABLE_STUB_LOG("XboxDe
|
||||
/* Xbox-only method */
|
||||
static HRESULT STDMETHODCALLTYPE x_Device_72(void*) { BX_VTABLE_STUB_LOG("XboxDevice", 72u, "SetGpuMemoryPriorityX"); return E_NOTIMPL; }
|
||||
/* Xbox-only method */
|
||||
static HRESULT STDMETHODCALLTYPE x_Device_76(void*) { BX_VTABLE_STUB_LOG("XboxDevice", 76u, "CreateCommittedResourceX"); return E_NOTIMPL; }
|
||||
/* Xbox-only method */
|
||||
static HRESULT STDMETHODCALLTYPE x_Device_77(void*) { BX_VTABLE_STUB_LOG("XboxDevice", 77u, "CreateComponentPlacedResourceX1"); return E_NOTIMPL; }
|
||||
/* Xbox-only method */
|
||||
static HRESULT STDMETHODCALLTYPE x_Device_81(void*) { BX_VTABLE_STUB_LOG("XboxDevice", 81u, "GetFrameStatisticsX"); return E_NOTIMPL; }
|
||||
/* Xbox-only method */
|
||||
static HRESULT STDMETHODCALLTYPE x_Device_82(void*) { BX_VTABLE_STUB_LOG("XboxDevice", 82u, "CreateCounterSetX"); return E_NOTIMPL; }
|
||||
static HRESULT STDMETHODCALLTYPE x_Device_83(void* self, const void * a0, SIZE_T a1, REFIID a2, void ** a3) {
|
||||
BX_D3D_TRACE("XboxDevice", "CreatePipelineLibrary");
|
||||
@@ -480,12 +476,12 @@ const void* const kDeviceTable[] = {
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_create_command_list_x),
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_register_page_pool_x),
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_unregister_page_pool_x),
|
||||
reinterpret_cast<const void*>(&x_Device_76),
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_create_committed_resource_x),
|
||||
reinterpret_cast<const void*>(&x_Device_77),
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_set_frame_interval_x),
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_schedule_frame_event_x),
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_wait_frame_event_x),
|
||||
reinterpret_cast<const void*>(&x_Device_81),
|
||||
reinterpret_cast<const void*>(&bx_xbox_device_get_frame_statistics_x),
|
||||
reinterpret_cast<const void*>(&x_Device_82),
|
||||
reinterpret_cast<const void*>(&x_Device_83),
|
||||
reinterpret_cast<const void*>(&x_Device_84),
|
||||
@@ -561,7 +557,7 @@ const IID kDeviceIids[] = {
|
||||
{0xc4fec28f, 0x7966, 0x4e95, {0x9f, 0x94, 0xf4, 0x31, 0xcb, 0x56, 0xc3, 0xb8}}, /* ID3D12Object */
|
||||
};
|
||||
|
||||
/* ID3D12Device11: 139 slots (54 forwarded, 44 shared, 41 stubs); hosted on ID3D12Device10. */
|
||||
/* ID3D12Device11: 139 slots (54 forwarded, 46 shared, 39 stubs); hosted on ID3D12Device10. */
|
||||
const IID kHostDevice = __uuidof(ID3D12Device10);
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE x_Resource_3(void* self, REFGUID a0, UINT * a1, void * a2) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
bx_add_shim_dll(gameinput GameInput GameInput.def
|
||||
gameinput.cpp
|
||||
keyboard_gamepad.cpp
|
||||
)
|
||||
target_link_libraries(gameinput PRIVATE bx_runtime_veh kernel32)
|
||||
target_link_libraries(gameinput PRIVATE bx_runtime_veh kernel32 user32)
|
||||
@@ -7,16 +7,19 @@
|
||||
#include <unordered_map>
|
||||
|
||||
#include "bx_log.h"
|
||||
#include "keyboard_gamepad.h"
|
||||
|
||||
namespace {
|
||||
// GameInputCreate @1 exposes the legacy v0 COM layout.
|
||||
constexpr GUID game_input_v0 = {0x11be2a7e, 0x4254, 0x445a,
|
||||
{0x9c, 0x09, 0xff, 0xc4, 0x0f, 0x00, 0x69, 0x18}};
|
||||
using Callback = void (WINAPI*)();
|
||||
using DeviceCallback = void (WINAPI*)(uint64_t, void*, IUnknown*, uint64_t, uint32_t, uint32_t);
|
||||
|
||||
// GameInputEnumerationKind values from Microsoft's public GDK GameInput (v0) reference:
|
||||
// 0 = GameInputNoEnumeration, 1 = GameInputAsyncEnumeration, 2 = GameInputBlockingEnumeration.
|
||||
constexpr uint32_t kMaxEnumerationKind = 2;
|
||||
constexpr uint32_t kAsyncEnumeration = 1;
|
||||
constexpr uint32_t kBlockingEnumeration = 2;
|
||||
|
||||
struct SrwExclusiveLock {
|
||||
explicit SrwExclusiveLock(SRWLOCK& lock) : lock_(lock) { AcquireSRWLockExclusive(&lock_); }
|
||||
@@ -34,7 +37,7 @@ struct RegisteredDeviceCallback {
|
||||
uint32_t status_filter = 0;
|
||||
uint32_t enumeration_kind = 0;
|
||||
void* context = nullptr;
|
||||
Callback callback = nullptr;
|
||||
DeviceCallback callback = nullptr;
|
||||
bool stopped = false;
|
||||
};
|
||||
|
||||
@@ -91,9 +94,15 @@ public:
|
||||
virtual uint64_t WINAPI GetCurrentTimestamp() {
|
||||
return GetTickCount64() * 1000;
|
||||
}
|
||||
virtual HRESULT WINAPI GetCurrentReading(uint32_t, void*, void** out) {
|
||||
BX_VTABLE_STUB_LOG("IGameInput", 4, "GetCurrentReading");
|
||||
return unavailable(out);
|
||||
virtual HRESULT WINAPI GetCurrentReading(uint32_t kind, void* device, void** out) {
|
||||
if (!out) return E_POINTER;
|
||||
*out = nullptr;
|
||||
if (!(kind & keyboard_gamepad::input_kind)) {
|
||||
BX_VTABLE_STUB_LOG("IGameInput", 4, "GetCurrentReading(non-gamepad)");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
if (device && device != keyboard_gamepad::device()) return keyboard_gamepad::device_not_found;
|
||||
return keyboard_gamepad::read(out);
|
||||
}
|
||||
virtual HRESULT WINAPI GetNextReading(void*, uint32_t, void*, void** out) {
|
||||
BX_VTABLE_STUB_LOG("IGameInput", 5, "GetNextReading");
|
||||
@@ -117,25 +126,45 @@ public:
|
||||
uint32_t status_filter,
|
||||
uint32_t enumeration_kind,
|
||||
void* context,
|
||||
Callback callback,
|
||||
DeviceCallback callback,
|
||||
uint64_t* out_token
|
||||
) {
|
||||
if (out_token) *out_token = 0;
|
||||
if (!callback || input_kind == 0 || status_filter == 0 || enumeration_kind > kMaxEnumerationKind) {
|
||||
if (!callback || input_kind == 0 || status_filter == 0 || enumeration_kind > kBlockingEnumeration) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
SrwExclusiveLock guard(callback_lock_);
|
||||
const uint64_t token = next_token_++;
|
||||
callbacks_.emplace(token, RegisteredDeviceCallback{
|
||||
device,
|
||||
input_kind,
|
||||
status_filter,
|
||||
enumeration_kind,
|
||||
context,
|
||||
callback,
|
||||
false,
|
||||
});
|
||||
uint64_t token;
|
||||
{
|
||||
SrwExclusiveLock guard(callback_lock_);
|
||||
token = next_token_++;
|
||||
callbacks_.emplace(token, RegisteredDeviceCallback{
|
||||
device,
|
||||
input_kind,
|
||||
status_filter,
|
||||
enumeration_kind,
|
||||
context,
|
||||
callback,
|
||||
false,
|
||||
});
|
||||
}
|
||||
if (out_token) *out_token = token;
|
||||
|
||||
auto* pad = keyboard_gamepad::device();
|
||||
const bool matches = (!device || device == pad) &&
|
||||
(input_kind & keyboard_gamepad::input_kind) &&
|
||||
(status_filter & keyboard_gamepad::device_status);
|
||||
if (matches && enumeration_kind == kBlockingEnumeration) {
|
||||
// The title requests blocking enumeration. The callback may reenter
|
||||
// GameInput, so never call it under the registration lock.
|
||||
static std::atomic_flag reported;
|
||||
if (!reported.test_and_set(std::memory_order_relaxed)) {
|
||||
bx_log_emit(BX_LOG_INFO, "gameinput", "keyboard_gamepad_connected",
|
||||
"keyboard gamepad announced through v0 device enumeration");
|
||||
}
|
||||
callback(token, context, pad, GetCurrentTimestamp(), keyboard_gamepad::device_status, 0);
|
||||
} else if (matches && enumeration_kind == kAsyncEnumeration) {
|
||||
BX_VTABLE_STUB_LOG("IGameInput", 9, "RegisterDeviceCallback(async gamepad enumeration)");
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
virtual HRESULT WINAPI RegisterSystemButtonCallback(void*, uint32_t, void*, Callback, uint64_t* out) {
|
||||
@@ -166,9 +195,15 @@ public:
|
||||
BX_VTABLE_STUB_LOG("IGameInput", 15, "CreateAggregateDevice");
|
||||
return unavailable(out);
|
||||
}
|
||||
virtual HRESULT WINAPI FindDeviceFromId(const void*, void** out) {
|
||||
BX_VTABLE_STUB_LOG("IGameInput", 16, "FindDeviceFromId");
|
||||
return unavailable(out);
|
||||
virtual HRESULT WINAPI FindDeviceFromId(const void* id, void** out) {
|
||||
if (!out) return E_POINTER;
|
||||
*out = nullptr;
|
||||
if (!id) return E_INVALIDARG;
|
||||
if (!keyboard_gamepad::has_id(id)) return keyboard_gamepad::device_not_found;
|
||||
auto* pad = keyboard_gamepad::device();
|
||||
pad->AddRef();
|
||||
*out = pad;
|
||||
return S_OK;
|
||||
}
|
||||
virtual HRESULT WINAPI FindDeviceFromObject(IUnknown*, void** out) {
|
||||
BX_VTABLE_STUB_LOG("IGameInput", 17, "FindDeviceFromObject");
|
||||
|
||||
@@ -0,0 +1,393 @@
|
||||
#include "keyboard_gamepad.h"
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <new>
|
||||
|
||||
#include "bx_log.h"
|
||||
|
||||
namespace keyboard_gamepad {
|
||||
namespace {
|
||||
|
||||
// Legacy GameInput v0 interface identities and Win64 data layouts.
|
||||
constexpr GUID device_iid = {0x31dd86fb, 0x4c1b, 0x408a, {0x86, 0x8f, 0x43, 0x9b, 0x3c, 0xd4, 0x71, 0x25}};
|
||||
constexpr GUID reading_iid = {0x2156947a, 0xe1fa, 0x4de0, {0xa3, 0x0b, 0xd8, 0x12, 0x93, 0x1d, 0xbd, 0x8d}};
|
||||
|
||||
struct GamepadState {
|
||||
uint32_t buttons;
|
||||
float left_trigger;
|
||||
float right_trigger;
|
||||
float left_x;
|
||||
float left_y;
|
||||
float right_x;
|
||||
float right_y;
|
||||
};
|
||||
static_assert(sizeof(GamepadState) == 28);
|
||||
|
||||
struct BatteryState {
|
||||
float rate, max_rate, remaining, capacity;
|
||||
uint32_t status;
|
||||
};
|
||||
static_assert(sizeof(BatteryState) == 20);
|
||||
|
||||
struct DeviceString {
|
||||
uint32_t bytes;
|
||||
uint32_t code_points;
|
||||
const char* text;
|
||||
};
|
||||
|
||||
using DeviceId = std::array<uint8_t, 32>;
|
||||
constexpr DeviceId device_id{{'B', 'e', 't', 't', 'e', 'r', 'X', 'e', 'n', '-', 'K', 'e', 'y', 'b', 'o', 'a', 'r', 'd'}};
|
||||
constexpr char device_name[] = "BetterXen Keyboard Gamepad";
|
||||
constexpr DeviceString display_name{
|
||||
sizeof(device_name) - 1, sizeof(device_name) - 1, device_name,
|
||||
};
|
||||
// Menu, View, A/B/X/Y, D-pad, shoulders, and stick clicks, in v0 label order.
|
||||
constexpr std::array<uint32_t, 14> gamepad_labels{{4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 17, 20}};
|
||||
|
||||
// The virtual device supplies only fixed-format gamepad data. The arrays group
|
||||
// the zero-valued v0 metadata for raw reports, other input kinds, and motors.
|
||||
struct DeviceInfo {
|
||||
uint32_t size;
|
||||
uint16_t vendor_id, product_id, revision;
|
||||
uint8_t interface_number, collection_number;
|
||||
uint16_t usage_page, usage;
|
||||
uint16_t hardware_version[4], firmware_version[4];
|
||||
DeviceId id, root_id;
|
||||
int32_t family;
|
||||
uint32_t capabilities, supported_input, supported_rumble;
|
||||
uint32_t counts[12];
|
||||
const void* other_input_info[12];
|
||||
const uint32_t* gamepad_info;
|
||||
const void* wheel_navigation_motor_info[4];
|
||||
const DeviceString* display_name;
|
||||
const void* device_strings;
|
||||
const void* descriptor;
|
||||
};
|
||||
static_assert(sizeof(DeviceInfo) == 320);
|
||||
static_assert(offsetof(DeviceInfo, id) == 32);
|
||||
static_assert(offsetof(DeviceInfo, supported_input) == 104);
|
||||
static_assert(offsetof(DeviceInfo, gamepad_info) == 256);
|
||||
static_assert(offsetof(DeviceInfo, display_name) == 296);
|
||||
|
||||
constexpr DeviceInfo device_info{
|
||||
.size = sizeof(DeviceInfo),
|
||||
.vendor_id = 0,
|
||||
.product_id = 0,
|
||||
.revision = 0,
|
||||
.interface_number = 0,
|
||||
.collection_number = 0,
|
||||
.usage_page = 1,
|
||||
.usage = 5,
|
||||
.hardware_version = {},
|
||||
.firmware_version = {},
|
||||
.id = device_id,
|
||||
.root_id = device_id,
|
||||
.family = -1, // GameInputFamilyVirtual
|
||||
.capabilities = 0,
|
||||
.supported_input = input_kind,
|
||||
.supported_rumble = 0,
|
||||
.counts = {},
|
||||
.other_input_info = {},
|
||||
.gamepad_info = gamepad_labels.data(),
|
||||
.wheel_navigation_motor_info = {},
|
||||
.display_name = &display_name,
|
||||
.device_strings = nullptr,
|
||||
.descriptor = nullptr,
|
||||
};
|
||||
|
||||
#define DEVICE_STUB(slot, method) BX_VTABLE_STUB_LOG("IGameInputDevice", slot, method)
|
||||
#define READING_STUB(slot, method) BX_VTABLE_STUB_LOG("IGameInputReading", slot, method)
|
||||
|
||||
class Device final : public IUnknown {
|
||||
LONG refs_ = 1; // The shim owns one reference for the lifetime of the device.
|
||||
|
||||
public:
|
||||
HRESULT WINAPI QueryInterface(REFIID iid, void** out) override {
|
||||
if (!out) return E_POINTER;
|
||||
*out = nullptr;
|
||||
if (iid != IID_IUnknown && iid != device_iid) return E_NOINTERFACE;
|
||||
AddRef();
|
||||
*out = this;
|
||||
return S_OK;
|
||||
}
|
||||
ULONG WINAPI AddRef() override { return InterlockedIncrement(&refs_); }
|
||||
ULONG WINAPI Release() override { return InterlockedDecrement(&refs_); }
|
||||
|
||||
virtual const DeviceInfo* WINAPI GetDeviceInfo() { return &device_info; }
|
||||
virtual uint32_t WINAPI GetDeviceStatus() { return device_status; }
|
||||
virtual void WINAPI GetBatteryState(BatteryState* out) { if (out) *out = {}; }
|
||||
virtual HRESULT WINAPI CreateForceFeedbackEffect(uint32_t, const void*, void** out) {
|
||||
DEVICE_STUB(6, "CreateForceFeedbackEffect");
|
||||
if (out) *out = nullptr;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual bool WINAPI IsForceFeedbackMotorPoweredOn(uint32_t) { return false; }
|
||||
virtual void WINAPI SetForceFeedbackMotorGain(uint32_t, float) { DEVICE_STUB(8, "SetForceFeedbackMotorGain"); }
|
||||
virtual HRESULT WINAPI SetHapticMotorState(uint32_t, const void*) {
|
||||
DEVICE_STUB(9, "SetHapticMotorState");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual void WINAPI SetRumbleState(const void*) { DEVICE_STUB(10, "SetRumbleState"); }
|
||||
virtual void WINAPI SetInputSynchronizationState(bool) { DEVICE_STUB(11, "SetInputSynchronizationState"); }
|
||||
virtual void WINAPI SendInputSynchronizationHint() { DEVICE_STUB(12, "SendInputSynchronizationHint"); }
|
||||
virtual void WINAPI PowerOff() { DEVICE_STUB(13, "PowerOff"); }
|
||||
virtual HRESULT WINAPI CreateRawDeviceReport(uint32_t, uint32_t, void** out) {
|
||||
DEVICE_STUB(14, "CreateRawDeviceReport");
|
||||
if (out) *out = nullptr;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual HRESULT WINAPI GetRawDeviceFeature(uint32_t, void** out) {
|
||||
DEVICE_STUB(15, "GetRawDeviceFeature");
|
||||
if (out) *out = nullptr;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual HRESULT WINAPI SetRawDeviceFeature(void*) {
|
||||
DEVICE_STUB(16, "SetRawDeviceFeature");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual HRESULT WINAPI SendRawDeviceOutput(void*) {
|
||||
DEVICE_STUB(17, "SendRawDeviceOutput");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual HRESULT WINAPI SendRawDeviceOutputWithResponse(void*, void** out) {
|
||||
DEVICE_STUB(18, "SendRawDeviceOutputWithResponse");
|
||||
if (out) *out = nullptr;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual HRESULT WINAPI ExecuteRawDeviceIoControl(uint32_t, size_t, const void*, size_t, void*, size_t* out) {
|
||||
DEVICE_STUB(19, "ExecuteRawDeviceIoControl");
|
||||
if (out) *out = 0;
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
virtual bool WINAPI AcquireExclusiveRawDeviceAccess(uint64_t) {
|
||||
DEVICE_STUB(20, "AcquireExclusiveRawDeviceAccess");
|
||||
return false;
|
||||
}
|
||||
virtual void WINAPI ReleaseExclusiveRawDeviceAccess() { DEVICE_STUB(21, "ReleaseExclusiveRawDeviceAccess"); }
|
||||
};
|
||||
Device virtual_device;
|
||||
|
||||
bool pressed(int key) { return (GetAsyncKeyState(key) & 0x8000) != 0; }
|
||||
|
||||
bool owns_foreground() {
|
||||
const HWND foreground = GetForegroundWindow();
|
||||
DWORD pid = 0;
|
||||
return foreground && GetWindowThreadProcessId(foreground, &pid) && pid == GetCurrentProcessId();
|
||||
}
|
||||
|
||||
void sample_stick(int left, int right, int down, int up, float& x, float& y) {
|
||||
x = static_cast<float>(pressed(right) - pressed(left));
|
||||
y = static_cast<float>(pressed(up) - pressed(down));
|
||||
if (x != 0 && y != 0) {
|
||||
constexpr float diagonal = 0.70710678f;
|
||||
x *= diagonal;
|
||||
y *= diagonal;
|
||||
}
|
||||
}
|
||||
|
||||
/* Diagnostic (off unless BX_INPUT_SCRIPT is set): scripted gamepad presses, so an unattended run
|
||||
can get past screens that wait for input without window focus. The script is a comma-separated
|
||||
list of BUTTON@SECONDS, for example "A@40,DOWN@50.5,A@52"; each press holds the button for
|
||||
300 ms, timed from the first reading of the keyboard gamepad. Buttons: MENU VIEW A B X Y UP DOWN
|
||||
LEFT RIGHT. Each press is logged once (input_script); an entry it cannot read is logged and
|
||||
skipped. */
|
||||
struct ScriptedPress {
|
||||
uint32_t button;
|
||||
uint64_t at_ms;
|
||||
};
|
||||
constexpr size_t kMaxScriptedPresses = 128;
|
||||
constexpr uint64_t kScriptedHoldMs = 300;
|
||||
|
||||
struct InputScript {
|
||||
ScriptedPress presses[kMaxScriptedPresses];
|
||||
std::atomic<bool> logged[kMaxScriptedPresses];
|
||||
size_t count = 0;
|
||||
uint64_t start_ms = 0;
|
||||
};
|
||||
|
||||
uint32_t script_button(const char* name, size_t length) {
|
||||
constexpr struct { const char* name; uint32_t bit; } names[] = {
|
||||
{"MENU", 0x1}, {"VIEW", 0x2}, {"A", 0x4}, {"B", 0x8}, {"X", 0x10},
|
||||
{"Y", 0x20}, {"UP", 0x40}, {"DOWN", 0x80}, {"LEFT", 0x100}, {"RIGHT", 0x200},
|
||||
};
|
||||
for (const auto& n : names) {
|
||||
if (std::strlen(n.name) == length && std::strncmp(n.name, name, length) == 0) return n.bit;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
InputScript* load_script() {
|
||||
char spec[2048] = {};
|
||||
const DWORD n = GetEnvironmentVariableA("BX_INPUT_SCRIPT", spec, sizeof(spec));
|
||||
if (n == 0 || n >= sizeof(spec)) return nullptr;
|
||||
auto* script = new (std::nothrow) InputScript();
|
||||
if (!script) return nullptr;
|
||||
for (const char* item = spec; *item && script->count < kMaxScriptedPresses;) {
|
||||
const char* end = std::strchr(item, ',');
|
||||
const size_t length = end ? static_cast<size_t>(end - item) : std::strlen(item);
|
||||
const char* at = static_cast<const char*>(std::memchr(item, '@', length));
|
||||
char seconds[32] = {};
|
||||
uint32_t button = 0;
|
||||
if (at && static_cast<size_t>(item + length - at - 1) < sizeof(seconds)) {
|
||||
std::memcpy(seconds, at + 1, static_cast<size_t>(item + length - at - 1));
|
||||
button = script_button(item, static_cast<size_t>(at - item));
|
||||
}
|
||||
char* parsed_end = nullptr;
|
||||
const double when = std::strtod(seconds, &parsed_end);
|
||||
if (button && parsed_end != seconds && *parsed_end == 0 && when >= 0) {
|
||||
script->presses[script->count++] = {button, static_cast<uint64_t>(when * 1000.0)};
|
||||
} else {
|
||||
char detail[96];
|
||||
std::snprintf(detail, sizeof(detail), "unreadable entry '%.*s' skipped", static_cast<int>(length < 40 ? length : 40), item);
|
||||
bx_log_emit(BX_LOG_WARN, "gameinput", "input_script", detail);
|
||||
}
|
||||
item = end ? end + 1 : item + length;
|
||||
}
|
||||
script->start_ms = GetTickCount64();
|
||||
return script;
|
||||
}
|
||||
|
||||
uint32_t scripted_buttons() {
|
||||
static InputScript* const script = load_script();
|
||||
if (!script) return 0;
|
||||
const uint64_t now = GetTickCount64() - script->start_ms;
|
||||
uint32_t buttons = 0;
|
||||
for (size_t i = 0; i < script->count; ++i) {
|
||||
const ScriptedPress& press = script->presses[i];
|
||||
if (now < press.at_ms || now >= press.at_ms + kScriptedHoldMs) continue;
|
||||
buttons |= press.button;
|
||||
if (!script->logged[i].exchange(true)) {
|
||||
char detail[96];
|
||||
std::snprintf(detail, sizeof(detail), "scripted press 0x%x at %.1f s", press.button, now / 1000.0);
|
||||
bx_log_emit(BX_LOG_INFO, "gameinput", "input_script", detail);
|
||||
}
|
||||
}
|
||||
return buttons;
|
||||
}
|
||||
|
||||
GamepadState sample_keyboard() {
|
||||
GamepadState state{};
|
||||
const uint32_t scripted = scripted_buttons();
|
||||
if (!owns_foreground()) {
|
||||
state.buttons = scripted;
|
||||
return state;
|
||||
}
|
||||
|
||||
constexpr struct KeyBinding { int key; uint32_t button; } buttons[] = {
|
||||
{'P', 0x1}, {VK_TAB, 0x2}, {VK_RETURN, 0x4}, {VK_SPACE, 0x4},
|
||||
{VK_ESCAPE, 0x8}, {VK_BACK, 0x8}, {'X', 0x10}, {'Y', 0x20},
|
||||
{VK_UP, 0x40}, {VK_DOWN, 0x80}, {VK_LEFT, 0x100}, {VK_RIGHT, 0x200},
|
||||
{'Q', 0x400}, {'E', 0x800}, {'F', 0x1000}, {'H', 0x2000},
|
||||
};
|
||||
for (const auto& binding : buttons) {
|
||||
if (pressed(binding.key)) state.buttons |= binding.button;
|
||||
}
|
||||
state.left_trigger = pressed('Z') ? 1.0f : 0.0f;
|
||||
state.right_trigger = pressed('C') ? 1.0f : 0.0f;
|
||||
sample_stick('A', 'D', 'S', 'W', state.left_x, state.left_y);
|
||||
sample_stick('J', 'L', 'K', 'I', state.right_x, state.right_y);
|
||||
if (!owns_foreground()) state = GamepadState{};
|
||||
state.buttons |= scripted;
|
||||
return state;
|
||||
}
|
||||
|
||||
struct Sample {
|
||||
GamepadState state{};
|
||||
uint64_t sequence = 0;
|
||||
uint64_t timestamp = 0;
|
||||
};
|
||||
|
||||
SRWLOCK sample_lock = SRWLOCK_INIT;
|
||||
Sample latest;
|
||||
|
||||
Sample sample() {
|
||||
AcquireSRWLockExclusive(&sample_lock);
|
||||
const GamepadState state = sample_keyboard();
|
||||
if (!latest.sequence || std::memcmp(&state, &latest.state, sizeof(state)) != 0) {
|
||||
latest = {state, latest.sequence + 1, GetTickCount64() * 1000};
|
||||
}
|
||||
const Sample snapshot = latest;
|
||||
ReleaseSRWLockExclusive(&sample_lock);
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
class Reading final : public IUnknown {
|
||||
LONG refs_ = 1;
|
||||
const Sample sample_;
|
||||
|
||||
public:
|
||||
explicit Reading(const Sample& value) : sample_(value) {}
|
||||
HRESULT WINAPI QueryInterface(REFIID iid, void** out) override {
|
||||
if (!out) return E_POINTER;
|
||||
*out = nullptr;
|
||||
if (iid != IID_IUnknown && iid != reading_iid) return E_NOINTERFACE;
|
||||
AddRef();
|
||||
*out = this;
|
||||
return S_OK;
|
||||
}
|
||||
ULONG WINAPI AddRef() override { return InterlockedIncrement(&refs_); }
|
||||
ULONG WINAPI Release() override {
|
||||
const auto left = InterlockedDecrement(&refs_);
|
||||
if (!left) delete this;
|
||||
return left;
|
||||
}
|
||||
|
||||
virtual uint32_t WINAPI GetInputKind() { return input_kind; }
|
||||
virtual uint64_t WINAPI GetSequenceNumber(uint32_t kind) { return kind & input_kind ? sample_.sequence : 0; }
|
||||
virtual uint64_t WINAPI GetTimestamp() { return sample_.timestamp; }
|
||||
virtual void WINAPI GetDevice(void** out) {
|
||||
if (!out) return;
|
||||
virtual_device.AddRef();
|
||||
*out = &virtual_device;
|
||||
}
|
||||
virtual bool WINAPI GetRawReport(void** out) {
|
||||
if (out) *out = nullptr;
|
||||
return false;
|
||||
}
|
||||
virtual uint32_t WINAPI GetControllerAxisCount() { return 0; }
|
||||
virtual uint32_t WINAPI GetControllerAxisState(uint32_t, float*) { return 0; }
|
||||
virtual uint32_t WINAPI GetControllerButtonCount() { return 0; }
|
||||
virtual uint32_t WINAPI GetControllerButtonState(uint32_t, bool*) { return 0; }
|
||||
virtual uint32_t WINAPI GetControllerSwitchCount() { return 0; }
|
||||
virtual uint32_t WINAPI GetControllerSwitchState(uint32_t, uint32_t*) { return 0; }
|
||||
virtual uint32_t WINAPI GetKeyCount() { return 0; }
|
||||
virtual uint32_t WINAPI GetKeyState(uint32_t, void*) { return 0; }
|
||||
virtual bool WINAPI GetMouseState(void*) { READING_STUB(16, "GetMouseState"); return false; }
|
||||
virtual uint32_t WINAPI GetTouchCount() { return 0; }
|
||||
virtual uint32_t WINAPI GetTouchState(uint32_t, void*) { return 0; }
|
||||
virtual bool WINAPI GetMotionState(void*) { READING_STUB(19, "GetMotionState"); return false; }
|
||||
virtual bool WINAPI GetArcadeStickState(void*) { READING_STUB(20, "GetArcadeStickState"); return false; }
|
||||
virtual bool WINAPI GetFlightStickState(void*) { READING_STUB(21, "GetFlightStickState"); return false; }
|
||||
virtual bool WINAPI GetGamepadState(GamepadState* out) {
|
||||
if (!out) return false;
|
||||
*out = sample_.state;
|
||||
static std::atomic_flag reported;
|
||||
if ((out->buttons || out->left_trigger || out->right_trigger || out->left_x || out->left_y ||
|
||||
out->right_x || out->right_y) && !reported.test_and_set(std::memory_order_relaxed)) {
|
||||
bx_log_emit(BX_LOG_INFO, "gameinput", "keyboard_gamepad_input",
|
||||
"guest read a non-neutral keyboard gamepad state");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
virtual bool WINAPI GetRacingWheelState(void*) { READING_STUB(23, "GetRacingWheelState"); return false; }
|
||||
virtual bool WINAPI GetUiNavigationState(void*) { READING_STUB(24, "GetUiNavigationState"); return false; }
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
IUnknown* device() { return &virtual_device; }
|
||||
|
||||
bool has_id(const void* id) {
|
||||
return id && std::memcmp(id, device_id.data(), device_id.size()) == 0;
|
||||
}
|
||||
|
||||
HRESULT read(void** out) {
|
||||
*out = new (std::nothrow) Reading(sample());
|
||||
return *out ? S_OK : E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
} // namespace keyboard_gamepad
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include <unknwn.h>
|
||||
#include <cstdint>
|
||||
|
||||
namespace keyboard_gamepad {
|
||||
|
||||
constexpr uint32_t input_kind = 0x00040000;
|
||||
constexpr uint32_t device_status = 0x3; // connected and input enabled
|
||||
constexpr HRESULT device_not_found = static_cast<HRESULT>(0x838a0002u);
|
||||
|
||||
IUnknown* device();
|
||||
bool has_id(const void* id);
|
||||
HRESULT read(void** out);
|
||||
|
||||
} // namespace keyboard_gamepad
|
||||
@@ -1330,6 +1330,56 @@ void disarm_diagnostics() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Diagnostic (off unless BX_CONTINUE_ASSERTS=1): a title's continuable assert is an int3 in its
|
||||
own executable followed by code that carries on when no debugger is attached to take it. With
|
||||
the switch, such an int3 in the main executable is stepped over instead of reaching the title's
|
||||
crash reporter. Each address is logged once (assert_continued), so the run report still lists
|
||||
every assert that fired. An int3 anywhere else (BetterXen, system or other modules) is left as
|
||||
it was. */
|
||||
static bool continue_assert(PEXCEPTION_POINTERS ep) {
|
||||
// Reading the switch and querying memory must not change the faulting thread's last-error
|
||||
// value, which the title may read after it continues (test_veh_breakpoint checks it).
|
||||
struct KeepLastError {
|
||||
DWORD saved = GetLastError();
|
||||
~KeepLastError() { SetLastError(saved); }
|
||||
} keep_last_error;
|
||||
static const bool enabled = [] {
|
||||
char v[4] = {};
|
||||
const DWORD n = GetEnvironmentVariableA("BX_CONTINUE_ASSERTS", v, sizeof(v));
|
||||
return n == 1 && v[0] == '1';
|
||||
}();
|
||||
if (!enabled) return false;
|
||||
const auto at = reinterpret_cast<uintptr_t>(ep->ExceptionRecord->ExceptionAddress);
|
||||
const auto exe = reinterpret_cast<uintptr_t>(GetModuleHandleW(nullptr));
|
||||
MEMORY_BASIC_INFORMATION region{};
|
||||
if (!VirtualQuery(reinterpret_cast<void*>(at), ®ion, sizeof(region)) ||
|
||||
reinterpret_cast<uintptr_t>(region.AllocationBase) != exe || *reinterpret_cast<const uint8_t*>(at) != 0xCC) {
|
||||
return false;
|
||||
}
|
||||
static std::atomic<uintptr_t> seen[256];
|
||||
bool first = true;
|
||||
for (auto& slot : seen) {
|
||||
uintptr_t value = slot.load();
|
||||
if (value == at) {
|
||||
first = false;
|
||||
break;
|
||||
}
|
||||
if (value == 0 && slot.compare_exchange_strong(value, at)) break;
|
||||
if (value == at) {
|
||||
first = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (first) {
|
||||
char detail[96];
|
||||
std::snprintf(detail, sizeof(detail), "title assert at rva 0x%llx stepped over",
|
||||
static_cast<unsigned long long>(at - exe));
|
||||
bx_log_emit(BX_LOG_WARN, "runtime_veh", "assert_continued", detail);
|
||||
}
|
||||
ep->ContextRecord->Rip = at + 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
LONG CALLBACK bx_veh_handler(PEXCEPTION_POINTERS ep) {
|
||||
if (!ep || !ep->ExceptionRecord || !ep->ContextRecord) {
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
@@ -1340,6 +1390,7 @@ LONG CALLBACK bx_veh_handler(PEXCEPTION_POINTERS ep) {
|
||||
const DWORD code = ep->ExceptionRecord->ExceptionCode;
|
||||
if (code == EXCEPTION_BREAKPOINT || code == kStatusAssertionFailure) {
|
||||
log_breakpoint(*ep->ExceptionRecord);
|
||||
if (code == EXCEPTION_BREAKPOINT && continue_assert(ep)) return EXCEPTION_CONTINUE_EXECUTION;
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
if (code == EXCEPTION_ACCESS_VIOLATION) {
|
||||
|
||||
@@ -55,7 +55,15 @@ struct Request {
|
||||
UINT compression;
|
||||
ID3D12Resource* resource = nullptr;
|
||||
UINT64 resource_offset = 0;
|
||||
DWORD output_size = 0; // compression_zlib: bytes the stream inflates to at `destination`
|
||||
DWORD output_size = 0; // compression_zlib/bcpack: bytes the stream decodes to at `destination`
|
||||
UINT bcpack_mode = 0; // compression_bcpack: DSTORAGE_BCPACK_MODE (BCn format 1-7)
|
||||
// Xbox physical-page destination: the title's array of 64 KB page numbers and the offset into
|
||||
// the first page. The title may fill the array after it enqueues the request, so the pages are
|
||||
// mapped into `page_span` only when the request runs, and unmapped once it has been fulfilled.
|
||||
const ULONG_PTR* page_array = nullptr;
|
||||
UINT32 page_offset = 0;
|
||||
void* page_span = nullptr;
|
||||
ULONG_PTR page_span_count = 0;
|
||||
};
|
||||
|
||||
inline constexpr UINT compression_none = 0;
|
||||
|
||||
+169
-11
@@ -456,6 +456,79 @@ CopyResult copy_staged(HANDLE file, const Request& request) {
|
||||
return staged.finish(win32_error());
|
||||
}
|
||||
|
||||
/* A title may read only the first part of a compressed block: the stream then holds more than
|
||||
DestinationSize bytes. The whole stream is decoded and checked (Adler-32), and its first
|
||||
`output_size` bytes are delivered. A stream shorter than the destination stays an error. */
|
||||
BxInflateResult inflate_first_part(const uint8_t* compressed, const Request& request) {
|
||||
const size_t capacity = static_cast<size_t>(request.output_size) * 64 + 0x40000;
|
||||
auto* whole = static_cast<uint8_t*>(HeapAlloc(GetProcessHeap(), 0, capacity));
|
||||
if (!whole) return BxInflateResult::output_mismatch;
|
||||
size_t produced = 0;
|
||||
BxInflateResult r = bx_zlib_inflate_any(compressed, request.size, whole, capacity, &produced);
|
||||
if (r == BxInflateResult::ok && produced > request.output_size) {
|
||||
std::memcpy(request.destination, whole, request.output_size);
|
||||
} else if (r == BxInflateResult::ok) {
|
||||
r = BxInflateResult::output_mismatch;
|
||||
}
|
||||
static std::atomic<UINT> logged{0};
|
||||
if (logged.fetch_add(1) < 16) {
|
||||
char detail[160];
|
||||
std::snprintf(detail, sizeof(detail), "zlib stream of %lu bytes holds %llu bytes, destination %lu: %s", request.size,
|
||||
static_cast<unsigned long long>(produced), request.output_size,
|
||||
r == BxInflateResult::ok ? "first part delivered" : bx_inflate_result_name(r));
|
||||
bx_log_emit(r == BxInflateResult::ok ? BX_LOG_INFO : BX_LOG_WARN, "xcrdapi", "dstorage_zlib_partial", detail);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, whole);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* BCPack (Xbox texture block compression, DSTORAGE_BCPACK_MODE). The codec is Microsoft's
|
||||
BCPack.dll from the GDK's PC tools, loaded from BX_BCPACK_DLL when set (each collaborator's own
|
||||
GDK; never shipped). Its documented entry point (GDK BCPack.h): BCPackDecompress(bcIndex,
|
||||
output, outputSize, packed, packedSize). Without it, BCPack requests stay refused (E_NOTIMPL). */
|
||||
using BcpackDecompressFn = HRESULT(__cdecl*)(size_t, void*, size_t, const void*, size_t);
|
||||
BcpackDecompressFn bcpack_decompress() {
|
||||
static const BcpackDecompressFn fn = [] {
|
||||
wchar_t path[MAX_PATH];
|
||||
const DWORD n = GetEnvironmentVariableW(L"BX_BCPACK_DLL", path, MAX_PATH);
|
||||
if (n == 0 || n >= MAX_PATH) return static_cast<BcpackDecompressFn>(nullptr);
|
||||
HMODULE dll = LoadLibraryW(path);
|
||||
auto found = dll ? reinterpret_cast<BcpackDecompressFn>(reinterpret_cast<void*>(GetProcAddress(dll, "BCPackDecompress")))
|
||||
: nullptr;
|
||||
char detail[96];
|
||||
std::snprintf(detail, sizeof(detail), "BX_BCPACK_DLL %s (error %lu)", found ? "loaded" : "not usable",
|
||||
found ? 0ul : GetLastError());
|
||||
bx_log_emit(found ? BX_LOG_INFO : BX_LOG_WARN, "xcrdapi", "bcpack_codec", detail);
|
||||
return found;
|
||||
}();
|
||||
return fn;
|
||||
}
|
||||
|
||||
HRESULT bcpack_request(HANDLE file, const Request& request) {
|
||||
const BcpackDecompressFn decompress = bcpack_decompress();
|
||||
if (!decompress) return E_NOTIMPL;
|
||||
if (!request.destination || !request.output_size || !request.size) return E_INVALIDARG;
|
||||
auto* packed = static_cast<uint8_t*>(HeapAlloc(GetProcessHeap(), 0, request.size));
|
||||
if (!packed) return E_OUTOFMEMORY;
|
||||
HRESULT hr = read_bytes(file, request.file_offset, packed, request.source, request.size);
|
||||
if (SUCCEEDED(hr)) {
|
||||
RemapGuard remap_guard;
|
||||
hr = decompress(request.bcpack_mode, request.destination, request.output_size, packed, request.size);
|
||||
if (FAILED(hr)) {
|
||||
static std::atomic<UINT> logged{0};
|
||||
if (logged.fetch_add(1) < 16) {
|
||||
char detail[160];
|
||||
std::snprintf(detail, sizeof(detail), "BCPack BC%u stream of %lu bytes to %lu bytes: hr=0x%08lx", request.bcpack_mode,
|
||||
request.size, request.output_size, static_cast<unsigned long>(hr));
|
||||
bx_log_emit(BX_LOG_WARN, "xcrdapi", "dstorage_bcpack_failed", detail);
|
||||
}
|
||||
hr = E_DSTORAGE_DECOMPRESSION_ERROR;
|
||||
}
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, packed);
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT inflate_request(HANDLE file, const Request& request) {
|
||||
if (!request.destination || !request.output_size || request.size >= request.output_size) return E_INVALIDARG;
|
||||
auto* compressed = static_cast<uint8_t*>(HeapAlloc(GetProcessHeap(), 0, request.size));
|
||||
@@ -463,8 +536,9 @@ HRESULT inflate_request(HANDLE file, const Request& request) {
|
||||
HRESULT hr = read_bytes(file, request.file_offset, compressed, request.source, request.size);
|
||||
if (SUCCEEDED(hr)) {
|
||||
RemapGuard remap_guard;
|
||||
const BxInflateResult r = bx_zlib_inflate(compressed, request.size, static_cast<uint8_t*>(request.destination),
|
||||
request.output_size);
|
||||
BxInflateResult r = bx_zlib_inflate(compressed, request.size, static_cast<uint8_t*>(request.destination),
|
||||
request.output_size);
|
||||
if (r == BxInflateResult::output_mismatch) r = inflate_first_part(compressed, request);
|
||||
if (r != BxInflateResult::ok) {
|
||||
static std::atomic<UINT> logged{0};
|
||||
if (logged.fetch_add(1) < 16) {
|
||||
@@ -498,7 +572,8 @@ CopyResult fulfill(HANDLE file, const Request& request) {
|
||||
if (!dstorage_trace_enabled() || request.resource) return result;
|
||||
static std::atomic<UINT> traced{0};
|
||||
if (traced.fetch_add(1) >= 20000) return result;
|
||||
const DWORD out = request.compression == compression_zlib ? request.output_size : request.size;
|
||||
const DWORD out = (request.compression == compression_zlib || request.compression == compression_bcpack) ? request.output_size
|
||||
: request.size;
|
||||
uint64_t head[2] = {0, 0};
|
||||
if (SUCCEEDED(result.hr) && request.destination && out >= 16) {
|
||||
RemapGuard remap_guard;
|
||||
@@ -515,6 +590,10 @@ CopyResult fulfill(HANDLE file, const Request& request) {
|
||||
}
|
||||
|
||||
CopyResult fulfill_request(HANDLE file, const Request& request) {
|
||||
if (request.compression == compression_bcpack && request.bcpack_mode) {
|
||||
if (request.resource) return {E_NOTIMPL, false};
|
||||
return {bcpack_request(file, request), false};
|
||||
}
|
||||
if (request.compression == compression_zlib) {
|
||||
if (request.resource) return {E_NOTIMPL, false};
|
||||
return {inflate_request(file, request), false};
|
||||
@@ -553,6 +632,56 @@ CopyResult fulfill_request(HANDLE file, const Request& request) {
|
||||
// before Submit: a full queue stalls the enqueuer until Submit is called on
|
||||
// another thread and the drain frees a slot. The public DirectStorage queues use
|
||||
// both; the BetterXen synthetic queues use neither.
|
||||
// Xbox physical-page destinations (DSTORAGE_REQUEST.DestinationPageArray, authorized GDK header):
|
||||
// 64 KB page numbers from XMemAllocatePhysicalPages. The request writes through a span of its own:
|
||||
// xmem.dll's XMemMapPhysicalPages with a NULL address (a BetterXen extension, see
|
||||
// shims/xmem/physical_pages.cpp) maps the pages contiguously, and the same call with a NULL page
|
||||
// array unmaps the span. The pages are sections, so the title's own views see the bytes.
|
||||
using MapPhysicalPagesFn = PVOID(WINAPI*)(PVOID, ULONG_PTR, PULONG_PTR);
|
||||
|
||||
MapPhysicalPagesFn map_physical_pages() {
|
||||
static const MapPhysicalPagesFn fn = [] {
|
||||
HMODULE xmem = GetModuleHandleW(L"xmem.dll");
|
||||
if (!xmem) xmem = LoadLibraryW(L"xmem.dll");
|
||||
return xmem ? reinterpret_cast<MapPhysicalPagesFn>(
|
||||
reinterpret_cast<void*>(GetProcAddress(xmem, "XMemMapPhysicalPages")))
|
||||
: nullptr;
|
||||
}();
|
||||
return fn;
|
||||
}
|
||||
|
||||
/* Maps a physical-page destination's pages when the request runs. The title can fill its page
|
||||
array after EnqueueRequest returns, so the array is read here, not at enqueue. */
|
||||
HRESULT map_page_destination(Request& request) {
|
||||
if (!request.page_array) return S_OK;
|
||||
const MapPhysicalPagesFn map = map_physical_pages();
|
||||
void* span = map ? map(nullptr, request.page_span_count, const_cast<PULONG_PTR>(request.page_array)) : nullptr;
|
||||
if (!span) {
|
||||
const DWORD error = map ? GetLastError() : ERROR_PROC_NOT_FOUND;
|
||||
char detail[128];
|
||||
std::snprintf(detail, sizeof(detail), "mapping %llu destination pages failed error=%lu",
|
||||
static_cast<unsigned long long>(request.page_span_count), error);
|
||||
bx_log_emit(BX_LOG_WARN, "xcrdapi", "dstorage_page_destination", detail);
|
||||
return HRESULT_FROM_WIN32(error);
|
||||
}
|
||||
request.page_span = span;
|
||||
request.destination = static_cast<BYTE*>(span) + request.page_offset;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void unmap_page_span(Request& request) {
|
||||
if (!request.page_span) return;
|
||||
const MapPhysicalPagesFn map = map_physical_pages();
|
||||
if (!map || !map(request.page_span, request.page_span_count, nullptr)) {
|
||||
char detail[96];
|
||||
std::snprintf(detail, sizeof(detail), "unmapping %llu destination pages failed error=%lu",
|
||||
static_cast<unsigned long long>(request.page_span_count), GetLastError());
|
||||
bx_log_emit(BX_LOG_WARN, "xcrdapi", "dstorage_page_destination", detail);
|
||||
}
|
||||
request.page_span = nullptr;
|
||||
request.page_span_count = 0;
|
||||
}
|
||||
|
||||
class WorkQueue final : public Object<Queue, queue_iid> {
|
||||
public:
|
||||
WorkQueue(Entry* entries, UINT capacity, bool blocking = false, UINT auto_submit = 0)
|
||||
@@ -578,7 +707,8 @@ public:
|
||||
Entry entry{Kind::request, *request};
|
||||
if (request->resource) request->resource->AddRef();
|
||||
// Uncompressed and zlib requests read the file; other compressions are refused when fulfilled.
|
||||
if (request->file && (request->compression == compression_none || request->compression == compression_zlib)) {
|
||||
if (request->file && (request->compression == compression_none || request->compression == compression_zlib ||
|
||||
request->compression == compression_bcpack)) {
|
||||
const HRESULT result = request->file->GetHandle(&entry.handle);
|
||||
if (FAILED(result)) {
|
||||
if (request->resource) request->resource->Release();
|
||||
@@ -769,8 +899,10 @@ private:
|
||||
HRESULT result = S_OK;
|
||||
switch (entry.kind) {
|
||||
case Kind::request: {
|
||||
const CopyResult outcome = fulfill(entry.handle, entry.request);
|
||||
const HRESULT mapped = map_page_destination(entry.request);
|
||||
const CopyResult outcome = SUCCEEDED(mapped) ? fulfill(entry.handle, entry.request) : CopyResult{mapped, false};
|
||||
result = outcome.hr;
|
||||
unmap_page_span(entry.request);
|
||||
if (entry.handle) CloseHandle(entry.handle);
|
||||
// keep_destination holds the AddRef taken at enqueue. Releasing
|
||||
// it while the staged copy is still on the GPU frees the dest.
|
||||
@@ -1404,8 +1536,10 @@ static_assert(offsetof(XboxQueueDesc, flags) == 0x18, "flags offset");
|
||||
|
||||
struct XboxRequest {
|
||||
UINT64 options; // +0x00: bit 22 (0x400000) = memory source, bit 0 = compressed
|
||||
void* destination; // +0x08
|
||||
UINT64 destination_pad; // +0x10
|
||||
void* destination; // +0x08: buffer, or the 64 KB page-number array (DestinationIsPhysicalPages)
|
||||
UINT16 destination_page_offset; // +0x10: offset into the first page (DestinationIsPhysicalPages)
|
||||
UINT16 reserved12;
|
||||
UINT32 reserved14;
|
||||
UINT32 destination_size; // +0x18
|
||||
UINT32 reserved1c; // +0x1c
|
||||
void* source_ptr; // +0x20: IXboxDStorageFile* (file) or const void* (memory)
|
||||
@@ -1416,6 +1550,7 @@ struct XboxRequest {
|
||||
static_assert(sizeof(XboxRequest) == 56, "XboxRequest must be 56 bytes");
|
||||
static_assert(offsetof(XboxRequest, options) == 0x00, "options offset");
|
||||
static_assert(offsetof(XboxRequest, destination) == 0x08, "destination offset");
|
||||
static_assert(offsetof(XboxRequest, destination_page_offset) == 0x10, "destination_page_offset offset");
|
||||
static_assert(offsetof(XboxRequest, destination_size) == 0x18, "destination_size offset");
|
||||
static_assert(offsetof(XboxRequest, source_ptr) == 0x20, "source_ptr offset");
|
||||
static_assert(offsetof(XboxRequest, file_offset) == 0x28, "file_offset offset");
|
||||
@@ -1563,7 +1698,10 @@ public:
|
||||
return;
|
||||
}
|
||||
log_request_options(request->options, request->source_size, request->destination_size, request->reserved34);
|
||||
if (request->options & kXboxRequestBcpackMask) {
|
||||
// BCPack (BcpackMode, DSTORAGE_BCPACK_MODE 1-7) is decoded by the GDK's BCPack.dll when
|
||||
// BX_BCPACK_DLL names it; combined with zlib, or without the codec, it stays refused.
|
||||
const UINT bcpack_mode = static_cast<UINT>((request->options & kXboxRequestBcpackMask) >> 1);
|
||||
if (bcpack_mode && ((request->options & kXboxRequestCompressedBit) || bcpack_mode > 7 || !bcpack_decompress())) {
|
||||
BX_VTABLE_STUB_LOG("IDStorageQueueX", 3u, "EnqueueRequest_bcpack");
|
||||
reject(E_NOTIMPL, Kind::request, "EnqueueRequest");
|
||||
return;
|
||||
@@ -1573,14 +1711,15 @@ public:
|
||||
reject(E_NOTIMPL, Kind::request, "EnqueueRequest");
|
||||
return;
|
||||
}
|
||||
if (request->options & (kXboxRequestDestinationPagesBit | kXboxRequestSourcePagesBit)) {
|
||||
BX_VTABLE_STUB_LOG("IDStorageQueueX", 3u, "EnqueueRequest_physical_pages");
|
||||
if (request->options & kXboxRequestSourcePagesBit) {
|
||||
BX_VTABLE_STUB_LOG("IDStorageQueueX", 3u, "EnqueueRequest_physical_page_source");
|
||||
reject(E_NOTIMPL, Kind::request, "EnqueueRequest");
|
||||
return;
|
||||
}
|
||||
const bool to_pages = (request->options & kXboxRequestDestinationPagesBit) != 0;
|
||||
const bool zlib = (request->options & kXboxRequestCompressedBit) != 0;
|
||||
if (!request->destination || (zlib ? request->source_size >= request->destination_size
|
||||
: request->source_size != request->destination_size)) {
|
||||
: (!bcpack_mode && request->source_size != request->destination_size))) {
|
||||
reject(E_DSTORAGE_INVALID_DESTINATION_SIZE, Kind::request, "EnqueueRequest");
|
||||
return;
|
||||
}
|
||||
@@ -1591,6 +1730,10 @@ public:
|
||||
if (zlib) {
|
||||
translated.compression = compression_zlib;
|
||||
translated.output_size = request->destination_size;
|
||||
} else if (bcpack_mode) {
|
||||
translated.compression = compression_bcpack;
|
||||
translated.bcpack_mode = bcpack_mode;
|
||||
translated.output_size = request->destination_size;
|
||||
}
|
||||
if (is_memory) {
|
||||
if (!request->source_ptr) {
|
||||
@@ -1607,6 +1750,21 @@ public:
|
||||
translated.file = file->inner();
|
||||
translated.file_offset = request->file_offset;
|
||||
}
|
||||
if (to_pages) {
|
||||
// DestinationSize bytes from DestinationPageOffset in the first page, across as many
|
||||
// 64 KB pages of the array as that covers.
|
||||
constexpr UINT64 page = 64 * 1024;
|
||||
const UINT64 end = static_cast<UINT64>(request->destination_page_offset) + request->destination_size;
|
||||
const ULONG_PTR count = static_cast<ULONG_PTR>((end + page - 1) / page);
|
||||
if (!map_physical_pages()) {
|
||||
reject(HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND), Kind::request, "EnqueueRequest");
|
||||
return;
|
||||
}
|
||||
// The array stays the title's: it is read when the request runs (map_page_destination).
|
||||
translated.page_array = static_cast<const ULONG_PTR*>(request->destination);
|
||||
translated.page_offset = request->destination_page_offset;
|
||||
translated.page_span_count = count;
|
||||
}
|
||||
accept(queue_->EnqueueRequest(&translated), Kind::request, "EnqueueRequest");
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ uint32_t adler32(const uint8_t* data, size_t size) {
|
||||
|
||||
} // namespace
|
||||
|
||||
BxInflateResult bx_zlib_inflate(const uint8_t* input, size_t input_size, uint8_t* output, size_t output_size) {
|
||||
BxInflateResult inflate_impl(const uint8_t* input, size_t input_size, uint8_t* output, size_t output_size, size_t* produced) {
|
||||
// RFC 1950 2.2: CMF (method 8 = deflate, window <= 32 KiB), FLG (check bits, no FDICT).
|
||||
if (!input || input_size < 6 || (!output && output_size)) return BxInflateResult::bad_header;
|
||||
const uint8_t cmf = input[0], flg = input[1];
|
||||
@@ -225,7 +225,8 @@ BxInflateResult bx_zlib_inflate(const uint8_t* input, size_t input_size, uint8_t
|
||||
if (r != BxInflateResult::ok) return r;
|
||||
if (final_block) break;
|
||||
}
|
||||
if (out.pos != out.size) return BxInflateResult::output_mismatch;
|
||||
if (produced) *produced = out.pos;
|
||||
else if (out.pos != out.size) return BxInflateResult::output_mismatch;
|
||||
// RFC 1950: the Adler-32 trailer follows the deflate data, byte-aligned, most significant first.
|
||||
in.align_to_byte();
|
||||
const size_t trailer = in.pos - static_cast<size_t>(in.count / 8);
|
||||
@@ -233,7 +234,16 @@ BxInflateResult bx_zlib_inflate(const uint8_t* input, size_t input_size, uint8_t
|
||||
const uint8_t* t = in.data + trailer;
|
||||
const uint32_t expected = (static_cast<uint32_t>(t[0]) << 24) | (static_cast<uint32_t>(t[1]) << 16) |
|
||||
(static_cast<uint32_t>(t[2]) << 8) | t[3];
|
||||
return adler32(output, output_size) == expected ? BxInflateResult::ok : BxInflateResult::bad_checksum;
|
||||
return adler32(output, out.pos) == expected ? BxInflateResult::ok : BxInflateResult::bad_checksum;
|
||||
}
|
||||
|
||||
BxInflateResult bx_zlib_inflate(const uint8_t* input, size_t input_size, uint8_t* output, size_t output_size) {
|
||||
return inflate_impl(input, input_size, output, output_size, nullptr);
|
||||
}
|
||||
|
||||
BxInflateResult bx_zlib_inflate_any(const uint8_t* input, size_t input_size, uint8_t* output, size_t capacity, size_t* produced) {
|
||||
*produced = 0;
|
||||
return inflate_impl(input, input_size, output, capacity, produced);
|
||||
}
|
||||
|
||||
const char* bx_inflate_result_name(BxInflateResult result) {
|
||||
|
||||
@@ -25,4 +25,8 @@ enum class BxInflateResult {
|
||||
/* Decodes `input` into exactly `output_size` bytes at `output`. */
|
||||
BxInflateResult bx_zlib_inflate(const uint8_t* input, size_t input_size, uint8_t* output, size_t output_size);
|
||||
|
||||
/* Decodes `input` into at most `capacity` bytes and reports how many the stream produced
|
||||
(checksum verified over those bytes). */
|
||||
BxInflateResult bx_zlib_inflate_any(const uint8_t* input, size_t input_size, uint8_t* output, size_t capacity, size_t* produced);
|
||||
|
||||
const char* bx_inflate_result_name(BxInflateResult result);
|
||||
+89
-15
@@ -85,6 +85,53 @@ void update_peak() {
|
||||
peak_bytes = std::max(peak_bytes, heap_bytes + virtual_bytes + physical_bytes + external_bytes);
|
||||
}
|
||||
|
||||
// The accounting as the internal ABI reports it. The caller holds usage_lock.
|
||||
bx_xmem_stats_t stats_locked() {
|
||||
return {title_limit(), heap_bytes + virtual_bytes + external_bytes, physical_bytes, peak_bytes};
|
||||
}
|
||||
|
||||
// XMEM_WORKING_SET_STATISTICS as the authorized GDK header lays it out for x64: SIZE_T fields
|
||||
// are 8 bytes and UINT32 fields 4, in declaration order with natural alignment.
|
||||
struct WorkingSetStatistics {
|
||||
uint64_t game_limit;
|
||||
uint64_t game_used;
|
||||
uint64_t tools_limit;
|
||||
uint64_t tools_used;
|
||||
uint32_t stack_used;
|
||||
uint32_t game_allocated_physical_page_count;
|
||||
uint64_t gpu_optimal_bandwidth_limit;
|
||||
uint64_t gpu_optimal_bandwidth_used;
|
||||
uint64_t tools_gpu_optimal_bandwidth_limit;
|
||||
uint64_t tools_gpu_optimal_bandwidth_used;
|
||||
uint32_t kernel_pool_used;
|
||||
uint32_t kernel_pool_limit;
|
||||
uint32_t direct_storage_used;
|
||||
uint32_t frame_preserve_buffer_size;
|
||||
uint64_t game_used_peak;
|
||||
uint32_t gpu_page_table_size;
|
||||
uint32_t cpu_page_table_size;
|
||||
uint64_t reserved[2];
|
||||
};
|
||||
static_assert(offsetof(WorkingSetStatistics, stack_used) == 0x20);
|
||||
static_assert(offsetof(WorkingSetStatistics, gpu_optimal_bandwidth_limit) == 0x28);
|
||||
static_assert(offsetof(WorkingSetStatistics, kernel_pool_used) == 0x48);
|
||||
static_assert(offsetof(WorkingSetStatistics, game_used_peak) == 0x58);
|
||||
static_assert(offsetof(WorkingSetStatistics, reserved) == 0x68);
|
||||
static_assert(sizeof(WorkingSetStatistics) == 0x78);
|
||||
|
||||
// XMEM_WORKING_SET_TITLE, _TOOLS, _STACK, _KERNEL_POOL and _CPU_PTE are 0x20000001, 0x20000002,
|
||||
// 0x20000004, 0x20000008 and 0x20000010: a shared 0x20000000 bit and one bit per category.
|
||||
constexpr DWORD working_set_marker = 0x20000000;
|
||||
constexpr DWORD working_set_categories = 0x1F;
|
||||
|
||||
bool valid_working_set_flags(DWORD flags) {
|
||||
return (flags & working_set_marker) && (flags & working_set_categories)
|
||||
&& !(flags & ~(working_set_marker | working_set_categories));
|
||||
}
|
||||
|
||||
// Physical pages are always 64 KiB (physical_pages.cpp).
|
||||
constexpr uint64_t physical_page_bytes = 64 * 1024;
|
||||
|
||||
uintptr_t region_end(const MEMORY_BASIC_INFORMATION& region) {
|
||||
return reinterpret_cast<uintptr_t>(region.BaseAddress) + region.RegionSize;
|
||||
}
|
||||
@@ -365,19 +412,47 @@ BOOL WINAPI XMemTransferMemory(PVOID dst, LPCVOID src, SIZE_T bytes, uint64_t /*
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(PVOID out_stats, SIZE_T stats_size) {
|
||||
if (!out_stats || stats_size < sizeof(bx_xmem_stats_t)) {
|
||||
/*
|
||||
* XMemGetWorkingSetStatistics(WorkingSetFlags, Statistics), as the authorized GDK header declares
|
||||
* it. The whole structure is written, whichever categories the flags select, from xmem's own
|
||||
* accounting:
|
||||
* - GameLimit: the title memory cap.
|
||||
* - GameUsed: everything the cap counts (XMem heap, virtual commits, physical pages and
|
||||
* external charges); GameUsedPeak is its highest value so far.
|
||||
* - GameAllocatedPhysicalPageCount: the 64 KiB physical pages allocated.
|
||||
* - Tools fields: 0, since tools memory is unavailable (XMemIsToolsMemAvailable).
|
||||
* - Every other field: 0. The host has no console kernel pool, GPU or CPU page tables,
|
||||
* frame-preserve buffer or separate GPU-optimal memory, and xmem does not count thread
|
||||
* stacks or DirectStorage buffers.
|
||||
* A NULL Statistics, or flags outside the five XMEM_WORKING_SET_* values, is refused.
|
||||
*/
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(DWORD flags, PVOID statistics) {
|
||||
if (!statistics || !valid_working_set_flags(flags)) {
|
||||
char detail[96];
|
||||
std::snprintf(detail, sizeof(detail), "refused flags=0x%lx statistics=%p",
|
||||
static_cast<unsigned long>(flags), statistics);
|
||||
bx_log_emit(BX_LOG_WARN, "xmem", "working_set_statistics", detail);
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
std::lock_guard guard(usage_lock);
|
||||
if (!refresh_virtual_commits()) {
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
bx_xmem_stats_t stats;
|
||||
{
|
||||
std::lock_guard guard(usage_lock);
|
||||
if (!refresh_virtual_commits()) {
|
||||
bx_log_emit(BX_LOG_ERROR, "xmem", "working_set_statistics",
|
||||
"refresh_virtual_commits failed; statistics not reported");
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
stats = stats_locked();
|
||||
}
|
||||
const bx_xmem_stats_t stats{title_limit(), heap_bytes + virtual_bytes + external_bytes, physical_bytes, peak_bytes};
|
||||
std::memset(out_stats, 0, stats_size);
|
||||
std::memcpy(out_stats, &stats, sizeof(stats));
|
||||
WorkingSetStatistics out{};
|
||||
out.game_limit = stats.title_limit_bytes;
|
||||
out.game_used = stats.committed_virtual_bytes + stats.allocated_physical_bytes;
|
||||
out.game_used_peak = stats.peak_committed_bytes;
|
||||
out.game_allocated_physical_page_count = static_cast<uint32_t>(std::min<uint64_t>(
|
||||
stats.allocated_physical_bytes / physical_page_bytes, std::numeric_limits<uint32_t>::max()));
|
||||
std::memcpy(statistics, &out, sizeof(out));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -387,12 +462,11 @@ BOOL WINAPI XMemIsToolsMemAvailable(void) {
|
||||
|
||||
void bx_xmem_get_internal_stats(bx_xmem_stats_t* out_stats) {
|
||||
if (!out_stats) return;
|
||||
if (!XMemGetWorkingSetStatistics(out_stats, sizeof(*out_stats))) {
|
||||
// The internal ABI has no error return. Preserve the most recent
|
||||
// accounting snapshot if refreshing it runs out of bookkeeping memory.
|
||||
std::lock_guard guard(usage_lock);
|
||||
*out_stats = {title_limit(), heap_bytes + virtual_bytes + external_bytes, physical_bytes, peak_bytes};
|
||||
}
|
||||
std::lock_guard guard(usage_lock);
|
||||
// The internal ABI has no error return. If refreshing runs out of bookkeeping memory, the
|
||||
// tracked commits are left as they were and the most recent snapshot is reported.
|
||||
(void)refresh_virtual_commits();
|
||||
*out_stats = stats_locked();
|
||||
}
|
||||
|
||||
int bx_xmem_try_charge_external(uint64_t bytes) {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
add_executable(test_console_mode main.cpp)
|
||||
target_link_libraries(test_console_mode PRIVATE xgameruntime advapi32 kernel32)
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* The console type in the registry. A title can read the REG_DWORD ConsoleMode under
|
||||
* HKLM\Software\Microsoft\Windows NT\CurrentVersion\OEM instead of calling XSystemGetDeviceType
|
||||
* (target-build observation): it opens the key with RegOpenKeyW, reads the value with
|
||||
* RegQueryValueExW and maps 0x60 to Series S, 0x64 to Series X and 0x68 to the Scarlett devkit;
|
||||
* with no key it takes itself for a PC and sizes its memory for Series X. The XSystemDeviceType
|
||||
* numbers below are those of the authorized GDK (XboxScarlettLockhart 6, XboxScarlettAnaconda 7,
|
||||
* XboxScarlettDevkit 8, Pc 1). This test reads the value the same way and checks it against the
|
||||
* BetterXen profile (BX_PROFILE, as bx-cli run sets it) and against XSystemGetDeviceType.
|
||||
*/
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
extern "C" uint32_t WINAPI XSystemGetDeviceType();
|
||||
|
||||
namespace {
|
||||
|
||||
#define CHECK(condition) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
std::fprintf(stderr, "console mode:%d: %s\n", __LINE__, #condition); \
|
||||
return 1; \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
// The title's mapping of ConsoleMode to XSystemDeviceType, written out from the observation.
|
||||
uint32_t device_type_for(DWORD mode) {
|
||||
switch (mode) {
|
||||
case 0x10: case 0x20: case 0x21: case 0x30: case 0x31: return 2; // XboxOne
|
||||
case 0x40: return 3; // XboxOneS
|
||||
case 0x50: return 4; // XboxOneX
|
||||
case 0x58: return 5; // XboxOneXDevkit
|
||||
case 0x60: return 6; // XboxScarlettLockhart
|
||||
case 0x64: return 7; // XboxScarlettAnaconda
|
||||
case 0x68: return 8; // XboxScarlettDevkit
|
||||
default: return 0; // Unknown
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
char profile[32] = {};
|
||||
GetEnvironmentVariableA("BX_PROFILE", profile, sizeof(profile));
|
||||
const bool anaconda = _stricmp(profile, "anaconda") == 0;
|
||||
const DWORD expected_mode = anaconda ? 0x64 : 0x60;
|
||||
|
||||
HKEY key = nullptr;
|
||||
CHECK(RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\OEM", &key) ==
|
||||
ERROR_SUCCESS); // without it the title takes itself for a PC
|
||||
DWORD mode = 0;
|
||||
DWORD type = 0;
|
||||
DWORD size = sizeof(mode);
|
||||
const LSTATUS status = RegQueryValueExW(key, L"ConsoleMode", nullptr, &type, reinterpret_cast<BYTE*>(&mode), &size);
|
||||
RegCloseKey(key);
|
||||
CHECK(status == ERROR_SUCCESS);
|
||||
CHECK(type == REG_DWORD && size == sizeof(DWORD));
|
||||
std::printf("ConsoleMode=0x%lx profile=%s XSystemGetDeviceType=%u\n", static_cast<unsigned long>(mode),
|
||||
anaconda ? "anaconda" : "lockhart", XSystemGetDeviceType());
|
||||
CHECK(mode == expected_mode);
|
||||
CHECK(device_type_for(mode) == (anaconda ? 7u : 6u));
|
||||
CHECK(device_type_for(mode) == XSystemGetDeviceType()); // both ways of asking agree
|
||||
|
||||
std::puts("PASS: test_console_mode");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
add_executable(test_d3d12_committed_resource_x main.cpp)
|
||||
target_compile_definitions(test_d3d12_committed_resource_x PRIVATE WIDL_EXPLICIT_AGGREGATE_RETURNS)
|
||||
target_link_libraries(test_d3d12_committed_resource_x PRIVATE d3d12_xs xmem kernel32 uuid)
|
||||
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* CreateCommittedResourceX (Xbox device table slot 76): CreateCommittedResource with a
|
||||
* D3D12XBOX_RESOURCE_DESC, which is the PC D3D12_RESOURCE_DESC followed by DccOptions, a struct of
|
||||
* two 32-bit enums, CompressionLevel and ColorTransform (authorized GDK header). The resource must be created with the PC part of the description,
|
||||
* whatever DccOptions says, and its memory requested through XMemAlloc like any committed
|
||||
* resource (AllocatorId D3D 128, ObjectType Resource 4), so a title hooking XMemAlloc sees it.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <d3d12.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
extern "C" __declspec(dllimport) HRESULT WINAPI D3D12XboxCreateDevice(PVOID adapter, const void* params, REFIID riid,
|
||||
void** ppv);
|
||||
extern "C" __declspec(dllimport) PVOID WINAPI XMemAllocDefault(SIZE_T, ULONGLONG);
|
||||
extern "C" __declspec(dllimport) VOID WINAPI XMemFreeDefault(PVOID, ULONGLONG);
|
||||
|
||||
namespace {
|
||||
|
||||
// D3D12XBOX_RESOURCE_DESC, written out from the GDK header's field list.
|
||||
struct DccOptions {
|
||||
UINT32 CompressionLevel; // D3D12XBOX_DCC_COMPRESSION_LEVEL: 64B 0, 128B 1, 256B 2, DEFAULT 3
|
||||
UINT32 ColorTransform; // D3D12XBOX_DCC_COLOR_TRANSFORM: 0..3
|
||||
};
|
||||
struct XboxResourceDesc {
|
||||
D3D12_RESOURCE_DESC pc;
|
||||
DccOptions Dcc;
|
||||
};
|
||||
static_assert(offsetof(XboxResourceDesc, Dcc) == 56, "DccOptions follows the 56-byte PC description");
|
||||
static_assert(sizeof(XboxResourceDesc) == 64, "DccOptions is two 32-bit enums");
|
||||
|
||||
constexpr ULONGLONG kD3DResource = (128ull << 16) | 4;
|
||||
int g_d3d_requests = 0;
|
||||
PVOID WINAPI alloc_hook(SIZE_T size, ULONGLONG attributes) {
|
||||
if ((attributes & ((0xFFull << 16) | 0x1F)) == kD3DResource) ++g_d3d_requests;
|
||||
return XMemAllocDefault(size, attributes);
|
||||
}
|
||||
VOID WINAPI free_hook(PVOID address, ULONGLONG attributes) { XMemFreeDefault(address, attributes); }
|
||||
|
||||
constexpr int kRelease = 2, kResGetDesc = 10, kDevCreateCommittedResourceX = 76;
|
||||
template <typename Fn>
|
||||
Fn slot(void* object, int index) {
|
||||
return reinterpret_cast<Fn>((*static_cast<void* const* const*>(object))[index]);
|
||||
}
|
||||
using ReleaseFn = ULONG(STDMETHODCALLTYPE*)(void*);
|
||||
using GetDescFn = void(STDMETHODCALLTYPE*)(void*, D3D12_RESOURCE_DESC*);
|
||||
using CreateCommittedXFn = HRESULT(STDMETHODCALLTYPE*)(void*, const D3D12_HEAP_PROPERTIES*, D3D12_HEAP_FLAGS,
|
||||
const XboxResourceDesc*, D3D12_RESOURCE_STATES,
|
||||
const D3D12_CLEAR_VALUE*, REFIID, void**);
|
||||
int g_failed = 0;
|
||||
#define CHECK(cond, ...) \
|
||||
do { \
|
||||
if (!(cond)) { \
|
||||
++g_failed; \
|
||||
std::fprintf(stderr, "FAIL: test_d3d12_committed_resource_x:%d: ", __LINE__); \
|
||||
std::fprintf(stderr, __VA_ARGS__); \
|
||||
std::fprintf(stderr, "\n"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void create_and_check(void* dev, const XboxResourceDesc& x, const char* what) {
|
||||
D3D12_HEAP_PROPERTIES heap{};
|
||||
heap.Type = D3D12_HEAP_TYPE_DEFAULT;
|
||||
const int before = g_d3d_requests;
|
||||
void* resource = nullptr;
|
||||
const HRESULT hr = slot<CreateCommittedXFn>(dev, kDevCreateCommittedResourceX)(
|
||||
dev, &heap, D3D12_HEAP_FLAG_NONE, &x, D3D12_RESOURCE_STATE_COMMON, nullptr, __uuidof(ID3D12Resource), &resource);
|
||||
CHECK(hr == S_OK && resource, "%s: hr=0x%08lx", what, static_cast<unsigned long>(hr));
|
||||
if (!resource) return;
|
||||
D3D12_RESOURCE_DESC got{};
|
||||
slot<GetDescFn>(resource, kResGetDesc)(resource, &got);
|
||||
CHECK(got.Dimension == x.pc.Dimension && got.Width == x.pc.Width && got.Height == x.pc.Height &&
|
||||
got.MipLevels == x.pc.MipLevels && got.Format == x.pc.Format,
|
||||
"%s: created with dim=%d %llux%u mips=%u format=%d", what, static_cast<int>(got.Dimension),
|
||||
static_cast<unsigned long long>(got.Width), got.Height, got.MipLevels, static_cast<int>(got.Format));
|
||||
CHECK(g_d3d_requests == before + 1, "%s: %d XMemAlloc requests for its memory", what, g_d3d_requests - before);
|
||||
std::printf("%s: hr=0x%08lx %llux%u format=%d, XMemAlloc requests=%d\n", what, static_cast<unsigned long>(hr),
|
||||
static_cast<unsigned long long>(got.Width), got.Height, static_cast<int>(got.Format),
|
||||
g_d3d_requests - before);
|
||||
slot<ReleaseFn>(resource, kRelease)(resource);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
struct AllocationHooks {
|
||||
PVOID(WINAPI* alloc)(SIZE_T, ULONGLONG);
|
||||
VOID(WINAPI* free)(PVOID, ULONGLONG);
|
||||
};
|
||||
extern "C" __declspec(dllexport) AllocationHooks __XMemAllocationHooks__ = {alloc_hook, free_hook};
|
||||
|
||||
int main() {
|
||||
alignas(8) unsigned char title_params[80] = {};
|
||||
const UINT version = 0x20004; // a non-zero version selects the Xbox-layout device
|
||||
std::memcpy(title_params, &version, sizeof(version));
|
||||
void* dev = nullptr;
|
||||
HRESULT hr = D3D12XboxCreateDevice(nullptr, title_params, __uuidof(ID3D12Device), &dev);
|
||||
if (hr == E_NOINTERFACE) {
|
||||
std::printf("SKIP: test_d3d12_committed_resource_x: host lacks the Xbox-layout device interface\n");
|
||||
return 77;
|
||||
}
|
||||
if (FAILED(hr) || !dev) {
|
||||
std::fprintf(stderr, "FAIL: device creation hr=0x%08lx\n", static_cast<unsigned long>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
XboxResourceDesc target{};
|
||||
target.pc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
target.pc.Width = 1920;
|
||||
target.pc.Height = 1080;
|
||||
target.pc.DepthOrArraySize = 1;
|
||||
target.pc.MipLevels = 1;
|
||||
target.pc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
target.pc.SampleDesc.Count = 1;
|
||||
target.pc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
|
||||
target.Dcc = {2, 3}; // 256B with a correlated colour transform: the host has no compression
|
||||
create_and_check(dev, target, "render target with DccOptions");
|
||||
|
||||
XboxResourceDesc buffer{};
|
||||
buffer.pc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
|
||||
buffer.pc.Width = 256 * 1024;
|
||||
buffer.pc.Height = 1;
|
||||
buffer.pc.DepthOrArraySize = 1;
|
||||
buffer.pc.MipLevels = 1;
|
||||
buffer.pc.SampleDesc.Count = 1;
|
||||
buffer.pc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
|
||||
create_and_check(dev, buffer, "buffer");
|
||||
|
||||
void* none = reinterpret_cast<void*>(1);
|
||||
D3D12_HEAP_PROPERTIES heap{};
|
||||
heap.Type = D3D12_HEAP_TYPE_DEFAULT;
|
||||
hr = slot<CreateCommittedXFn>(dev, kDevCreateCommittedResourceX)(dev, &heap, D3D12_HEAP_FLAG_NONE, nullptr,
|
||||
D3D12_RESOURCE_STATE_COMMON, nullptr,
|
||||
__uuidof(ID3D12Resource), &none);
|
||||
CHECK(hr == E_INVALIDARG, "null description: hr=0x%08lx", static_cast<unsigned long>(hr));
|
||||
|
||||
slot<ReleaseFn>(dev, kRelease)(dev);
|
||||
if (g_failed) return 1;
|
||||
std::puts("PASS: test_d3d12_committed_resource_x");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
add_executable(test_d3d12_frame_statistics_x main.cpp)
|
||||
target_compile_definitions(test_d3d12_frame_statistics_x PRIVATE WIDL_EXPLICIT_AGGREGATE_RETURNS)
|
||||
target_link_libraries(test_d3d12_frame_statistics_x PRIVATE d3d12_xs kernel32 uuid)
|
||||
@@ -0,0 +1,228 @@
|
||||
/*
|
||||
* GetFrameStatisticsX (Xbox device table slot 81), against the authorized GDK documentation:
|
||||
* GetFrameStatisticsX(Token, TypeSet, pCount, pStatistics) returns S_OK when one or more sets of
|
||||
* the requested types are available (written subject to list space, *pCount updated to the
|
||||
* number written), S_FALSE when none is available yet, and E_INVALIDARG for unknown frame
|
||||
* pipeline tokens, invalid type sets and invalid list arrangements. The runtime keeps the last
|
||||
* 17 frames. Times are QueryPerformanceCounter values.
|
||||
* D3D12XBOX_FRAME_STATISTICS is written out below from the header's field list: a 32-bit Type,
|
||||
* then (8 bytes in) a union whose largest members are 48 bytes. Tokens come from WaitFrameEventX
|
||||
* on the ORIGIN event; PresentX gets the token through its plane parameters.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <d3d12.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
extern "C" __declspec(dllimport) HRESULT WINAPI D3D12XboxCreateDevice(PVOID adapter, const void* params, REFIID riid,
|
||||
void** ppv);
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr UINT kTypeFrameEvent = 0x2, kTypeRender = 0x100, kTypePresent = 0x1000;
|
||||
constexpr UINT kOrigin = 0;
|
||||
|
||||
struct FrameEventStatistics {
|
||||
UINT32 EventType;
|
||||
UINT64 WaitCallTime;
|
||||
UINT64 SignalTime;
|
||||
UINT64 WaitReturnTime;
|
||||
UINT32 IntervalOffsetInMicroseconds;
|
||||
UINT32 SignalFlags;
|
||||
UINT32 StatisticsFlags;
|
||||
};
|
||||
struct PresentStatistics {
|
||||
UINT8 PlaneIndex;
|
||||
UINT8 PlaneCount;
|
||||
UINT8 ViewCount;
|
||||
UINT64 PresentCallTime;
|
||||
UINT64 PresentQueueTime;
|
||||
UINT64 PresentReturnTime;
|
||||
UINT64 GPUProcessTime;
|
||||
UINT8 QueuedFrameCount;
|
||||
UINT16 PlaneSwapMask;
|
||||
UINT32 Flags;
|
||||
};
|
||||
struct FrameStatistics {
|
||||
UINT32 Type;
|
||||
union {
|
||||
FrameEventStatistics Event;
|
||||
PresentStatistics Present;
|
||||
UINT8 Bytes[48];
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(FrameStatistics) == 56 && offsetof(FrameStatistics, Event) == 8, "D3D12XBOX_FRAME_STATISTICS");
|
||||
|
||||
struct PlaneParameters { // D3D12XBOX_PRESENT_PLANE_PARAMETERS
|
||||
UINT64 Token;
|
||||
UINT ResourceCount;
|
||||
void** ppResources;
|
||||
D3D12_RECT* pSrcViewRects;
|
||||
void* pDestPlacementBase;
|
||||
UINT ColorSpace;
|
||||
UINT ScaleFilter;
|
||||
UINT ExtendedDescCount;
|
||||
void* pExtendedDescs;
|
||||
UINT Flags;
|
||||
};
|
||||
|
||||
constexpr int kRelease = 2, kDevCreateCommandQueue = 8, kDevCreateCommittedResource = 27;
|
||||
constexpr int kDevSetFrameIntervalX = 78, kDevScheduleFrameEventX = 79, kDevWaitFrameEventX = 80;
|
||||
constexpr int kDevGetFrameStatisticsX = 81, kQueuePresentX = 32;
|
||||
|
||||
template <typename Fn>
|
||||
Fn slot(void* object, int index) {
|
||||
return reinterpret_cast<Fn>((*static_cast<void* const* const*>(object))[index]);
|
||||
}
|
||||
using ReleaseFn = ULONG(STDMETHODCALLTYPE*)(void*);
|
||||
using CreateQueueFn = HRESULT(STDMETHODCALLTYPE*)(void*, const D3D12_COMMAND_QUEUE_DESC*, REFIID, void**);
|
||||
using CreateCommittedFn = HRESULT(STDMETHODCALLTYPE*)(void*, const D3D12_HEAP_PROPERTIES*, D3D12_HEAP_FLAGS,
|
||||
const D3D12_RESOURCE_DESC*, D3D12_RESOURCE_STATES,
|
||||
const D3D12_CLEAR_VALUE*, REFIID, void**);
|
||||
using SetIntervalFn = HRESULT(STDMETHODCALLTYPE*)(void*, void*, UINT, UINT, UINT);
|
||||
using ScheduleFn = HRESULT(STDMETHODCALLTYPE*)(void*, UINT, UINT, const void*, UINT);
|
||||
using WaitFn = HRESULT(STDMETHODCALLTYPE*)(void*, UINT, UINT, const void*, UINT, UINT64*);
|
||||
using StatsFn = HRESULT(STDMETHODCALLTYPE*)(void*, UINT64, UINT, UINT*, FrameStatistics*);
|
||||
using PresentFn = HRESULT(STDMETHODCALLTYPE*)(void*, UINT, const PlaneParameters*, const void*);
|
||||
|
||||
int g_failed = 0, g_checks = 0;
|
||||
#define CHECK(cond, ...) \
|
||||
do { \
|
||||
++g_checks; \
|
||||
if (!(cond)) { \
|
||||
++g_failed; \
|
||||
std::fprintf(stderr, "FAIL: test_d3d12_frame_statistics_x:%d: ", __LINE__); \
|
||||
std::fprintf(stderr, __VA_ARGS__); \
|
||||
std::fprintf(stderr, "\n"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
alignas(8) unsigned char title_params[80] = {};
|
||||
const UINT version = 0x20004;
|
||||
std::memcpy(title_params, &version, sizeof(version));
|
||||
void* dev = nullptr;
|
||||
HRESULT hr = D3D12XboxCreateDevice(nullptr, title_params, __uuidof(ID3D12Device), &dev);
|
||||
if (hr == E_NOINTERFACE) {
|
||||
std::printf("SKIP: test_d3d12_frame_statistics_x: host lacks the Xbox-layout device interface\n");
|
||||
return 77;
|
||||
}
|
||||
if (FAILED(hr) || !dev) {
|
||||
std::fprintf(stderr, "FAIL: device creation hr=0x%08lx\n", static_cast<unsigned long>(hr));
|
||||
return 1;
|
||||
}
|
||||
auto stats = slot<StatsFn>(dev, kDevGetFrameStatisticsX);
|
||||
FrameStatistics out[4]{};
|
||||
UINT count = 4;
|
||||
|
||||
// Invalid arrangements, type sets and tokens.
|
||||
CHECK(stats(dev, 1, kTypeFrameEvent, nullptr, out) == E_INVALIDARG, "null pCount");
|
||||
CHECK(stats(dev, 1, 0, &count, out) == E_INVALIDARG, "empty type set");
|
||||
count = 4;
|
||||
CHECK(stats(dev, 1, 0x8, &count, out) == E_INVALIDARG, "unknown type bit");
|
||||
count = 4;
|
||||
CHECK(stats(dev, 1, kTypeFrameEvent, &count, nullptr) == E_INVALIDARG, "entries but no list");
|
||||
count = 4;
|
||||
CHECK(stats(dev, 0, kTypeFrameEvent, &count, out) == E_INVALIDARG, "token 0");
|
||||
count = 4;
|
||||
CHECK(stats(dev, 1ull << 40, kTypeFrameEvent, &count, out) == E_INVALIDARG, "token never issued");
|
||||
|
||||
// One frame: the ORIGIN event gives a token.
|
||||
CHECK(slot<SetIntervalFn>(dev, kDevSetFrameIntervalX)(dev, nullptr, 16667, 1, 0) == S_OK, "SetFrameIntervalX");
|
||||
CHECK(slot<ScheduleFn>(dev, kDevScheduleFrameEventX)(dev, kOrigin, 0, nullptr, 0) == S_OK, "ScheduleFrameEventX");
|
||||
auto wait = slot<WaitFn>(dev, kDevWaitFrameEventX);
|
||||
UINT64 token = 0;
|
||||
hr = wait(dev, kOrigin, 2000, nullptr, 0, &token);
|
||||
CHECK(hr == S_OK && token != 0, "WaitFrameEventX(ORIGIN) hr=0x%08lx token=%llu", static_cast<unsigned long>(hr),
|
||||
static_cast<unsigned long long>(token));
|
||||
|
||||
count = 4;
|
||||
hr = stats(dev, token, kTypeFrameEvent, &count, out);
|
||||
CHECK(hr == S_OK && count == 1, "FRAME_EVENT: hr=0x%08lx count=%u", static_cast<unsigned long>(hr), count);
|
||||
if (hr == S_OK && count == 1) {
|
||||
const FrameEventStatistics& e = out[0].Event;
|
||||
CHECK(out[0].Type == kTypeFrameEvent && e.EventType == kOrigin, "FRAME_EVENT type %u event %u", out[0].Type,
|
||||
e.EventType);
|
||||
CHECK(e.SignalTime && e.WaitCallTime && e.WaitReturnTime >= e.SignalTime && e.WaitReturnTime >= e.WaitCallTime,
|
||||
"FRAME_EVENT times wait=%llu signal=%llu return=%llu", static_cast<unsigned long long>(e.WaitCallTime),
|
||||
static_cast<unsigned long long>(e.SignalTime), static_cast<unsigned long long>(e.WaitReturnTime));
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
CHECK(e.WaitReturnTime <= static_cast<UINT64>(now.QuadPart), "times are QueryPerformanceCounter values");
|
||||
}
|
||||
count = 4;
|
||||
CHECK(stats(dev, token, kTypePresent, &count, out) == S_FALSE && count == 0, "PRESENT before PresentX: S_FALSE");
|
||||
count = 4;
|
||||
CHECK(stats(dev, token, kTypeRender, &count, out) == S_FALSE && count == 0, "RENDER (no host source): S_FALSE");
|
||||
|
||||
// PresentX with that token records the present.
|
||||
D3D12_COMMAND_QUEUE_DESC queue_desc{};
|
||||
queue_desc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
|
||||
void* queue = nullptr;
|
||||
hr = slot<CreateQueueFn>(dev, kDevCreateCommandQueue)(dev, &queue_desc, __uuidof(ID3D12CommandQueue), &queue);
|
||||
CHECK(hr == S_OK && queue, "CreateCommandQueue hr=0x%08lx", static_cast<unsigned long>(hr));
|
||||
D3D12_HEAP_PROPERTIES heap{};
|
||||
heap.Type = D3D12_HEAP_TYPE_DEFAULT;
|
||||
D3D12_RESOURCE_DESC rt{};
|
||||
rt.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
rt.Width = 64;
|
||||
rt.Height = 64;
|
||||
rt.DepthOrArraySize = 1;
|
||||
rt.MipLevels = 1;
|
||||
rt.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
rt.SampleDesc.Count = 1;
|
||||
rt.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
|
||||
void* target = nullptr;
|
||||
hr = slot<CreateCommittedFn>(dev, kDevCreateCommittedResource)(dev, &heap, D3D12_HEAP_FLAG_NONE, &rt,
|
||||
D3D12_RESOURCE_STATE_COMMON, nullptr,
|
||||
__uuidof(ID3D12Resource), &target);
|
||||
CHECK(hr == S_OK && target, "render target hr=0x%08lx", static_cast<unsigned long>(hr));
|
||||
if (queue && target) {
|
||||
PlaneParameters plane{};
|
||||
plane.Token = token;
|
||||
plane.ResourceCount = 1;
|
||||
plane.ppResources = ⌖
|
||||
slot<PresentFn>(queue, kQueuePresentX)(queue, 1, &plane, nullptr);
|
||||
count = 4;
|
||||
hr = stats(dev, token, kTypeFrameEvent | kTypePresent, &count, out);
|
||||
CHECK(hr == S_OK && count == 2, "FRAME_EVENT|PRESENT after PresentX: hr=0x%08lx count=%u",
|
||||
static_cast<unsigned long>(hr), count);
|
||||
for (UINT i = 0; i < count; ++i) {
|
||||
if (out[i].Type != kTypePresent) continue;
|
||||
const PresentStatistics& p = out[i].Present;
|
||||
CHECK(p.PresentCallTime && p.PresentReturnTime >= p.PresentCallTime && p.PlaneCount == 1,
|
||||
"PRESENT call=%llu return=%llu planes=%u", static_cast<unsigned long long>(p.PresentCallTime),
|
||||
static_cast<unsigned long long>(p.PresentReturnTime), p.PlaneCount);
|
||||
}
|
||||
// A size query (no list) reports how many are available; a short list gets what fits.
|
||||
count = 0;
|
||||
CHECK(stats(dev, token, kTypeFrameEvent | kTypePresent, &count, nullptr) == S_OK && count == 2, "size query: %u",
|
||||
count);
|
||||
count = 1;
|
||||
CHECK(stats(dev, token, kTypeFrameEvent | kTypePresent, &count, out) == S_OK && count == 1, "short list: %u",
|
||||
count);
|
||||
}
|
||||
|
||||
// Seventeen frames later the token has no statistics left.
|
||||
UINT64 later = token;
|
||||
for (int i = 0; i < 18; ++i) wait(dev, kOrigin, 2000, nullptr, 0, &later);
|
||||
count = 4;
|
||||
CHECK(stats(dev, token, kTypeFrameEvent, &count, out) == S_FALSE && count == 0, "token 18 frames old: S_FALSE");
|
||||
count = 4;
|
||||
CHECK(stats(dev, later, kTypeFrameEvent, &count, out) == S_OK && count == 1, "latest token: S_OK");
|
||||
|
||||
if (target) slot<ReleaseFn>(target, kRelease)(target);
|
||||
if (queue) slot<ReleaseFn>(queue, kRelease)(queue);
|
||||
slot<ReleaseFn>(dev, kRelease)(dev);
|
||||
if (g_failed) {
|
||||
std::printf("FAIL: test_d3d12_frame_statistics_x (%d of %d checks failed)\n", g_failed, g_checks);
|
||||
return 1;
|
||||
}
|
||||
std::printf("PASS: test_d3d12_frame_statistics_x (%d checks)\n", g_checks);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
# A stand-in for the GDK's XG library with known answers, built as xg_xs.dll in its own folder so
|
||||
# it never replaces the xg_xs shim beside the other DLLs. The test loads it by full path.
|
||||
add_library(test_gdk_xg_fake SHARED fake_xg.cpp)
|
||||
# Its import library goes to its own folder too, or it would replace the xg_xs shim's.
|
||||
set_target_properties(test_gdk_xg_fake PROPERTIES OUTPUT_NAME xg_xs PREFIX ""
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gdk_xg_fake"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/gdk_xg_fake_lib")
|
||||
target_link_libraries(test_gdk_xg_fake PRIVATE kernel32)
|
||||
|
||||
add_executable(test_d3d12_gdk_xg_sizes main.cpp)
|
||||
target_compile_definitions(test_d3d12_gdk_xg_sizes PRIVATE WIDL_EXPLICIT_AGGREGATE_RETURNS)
|
||||
target_link_libraries(test_d3d12_gdk_xg_sizes PRIVATE d3d12_xs kernel32 uuid)
|
||||
add_dependencies(test_d3d12_gdk_xg_sizes test_gdk_xg_fake)
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* A stand-in for the GDK's XG library (xg_xs.dll) with answers the test can compute. It has the
|
||||
* documented shape the shim relies on (GDK xg_xs.h): the exports XGComputeTexture2DLayout (whose
|
||||
* presence marks Microsoft's library), XGCreateTextureComputer and XGEnableExclusiveLocking, and a
|
||||
* texture computer whose vtable starts AddRef, Release, GetResourceLayout, GetResourceSizeBytes,
|
||||
* GetResourceBaseAlignmentBytes. It is not Microsoft's code and computes no real layout.
|
||||
*
|
||||
* Its answer for a texture: size = Width * Height * DepthOrArraySize * 16 + (Layout & 0xFF) * 0x1000,
|
||||
* alignment = 0x10000 when the layout is 0x109 (a 64 KB mode), otherwise 0x1000.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <d3d12.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace {
|
||||
|
||||
struct Computer;
|
||||
struct Vtbl {
|
||||
ULONG(__cdecl* AddRef)(Computer*);
|
||||
ULONG(__cdecl* Release)(Computer*);
|
||||
HRESULT(__cdecl* GetResourceLayout)(Computer*, void*);
|
||||
UINT64 (*GetResourceSizeBytes)(Computer*);
|
||||
UINT64 (*GetResourceBaseAlignmentBytes)(Computer*);
|
||||
};
|
||||
struct Computer {
|
||||
const Vtbl* vtbl;
|
||||
LONG refs;
|
||||
UINT64 size;
|
||||
UINT64 alignment;
|
||||
};
|
||||
|
||||
ULONG __cdecl add_ref(Computer* c) { return static_cast<ULONG>(InterlockedIncrement(&c->refs)); }
|
||||
ULONG __cdecl release(Computer* c) {
|
||||
const LONG left = InterlockedDecrement(&c->refs);
|
||||
if (!left) HeapFree(GetProcessHeap(), 0, c);
|
||||
return static_cast<ULONG>(left);
|
||||
}
|
||||
HRESULT __cdecl layout(Computer*, void*) { return E_NOTIMPL; }
|
||||
UINT64 size_bytes(Computer* c) { return c->size; }
|
||||
UINT64 alignment_bytes(Computer* c) { return c->alignment; }
|
||||
const Vtbl kVtbl = {add_ref, release, layout, size_bytes, alignment_bytes};
|
||||
|
||||
LONG g_locking = 0;
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" __declspec(dllexport) HRESULT __cdecl XGComputeTexture2DLayout(const void*, void*) { return E_NOTIMPL; }
|
||||
|
||||
extern "C" __declspec(dllexport) HRESULT __cdecl XGCreateTextureComputer(const D3D12_RESOURCE_DESC* desc, Computer** out) {
|
||||
if (!desc || !out) return E_INVALIDARG;
|
||||
auto* c = static_cast<Computer*>(HeapAlloc(GetProcessHeap(), 0, sizeof(Computer)));
|
||||
if (!c) return E_OUTOFMEMORY;
|
||||
const UINT layout_value = static_cast<UINT>(desc->Layout);
|
||||
c->vtbl = &kVtbl;
|
||||
c->refs = 1;
|
||||
c->size = desc->Width * desc->Height * desc->DepthOrArraySize * 16ull + (layout_value & 0xFF) * 0x1000ull;
|
||||
c->alignment = layout_value == 0x109 ? 0x10000 : 0x1000;
|
||||
*out = c;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) void __cdecl XGEnableExclusiveLocking(BOOL enabled) { g_locking = enabled ? 1 : 0; }
|
||||
|
||||
// For the test: whether the shim enabled XG's locking.
|
||||
extern "C" __declspec(dllexport) LONG __cdecl FakeXGLockingEnabled() { return g_locking; }
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* GetResourceAllocationInfo for console texture layouts, answered by the GDK's XG library.
|
||||
*
|
||||
* Console textures carry a tiled layout (D3D12XBOX_TEXTURE_LAYOUT, 0x100 | swizzle mode), and a
|
||||
* title sizes its loads and placements from the allocation size the device reports. When the
|
||||
* GDK's XG library is the loaded xg_xs.dll, d3d12_xs answers console layouts with XG's size and
|
||||
* base alignment, and everything else with the host's answer; several descriptions are laid out
|
||||
* one after another at their alignments (Direct3D 12 rules), the total aligned to the largest.
|
||||
*
|
||||
* The library here is a stand-in with answers this test computes (fake_xg.cpp), not Microsoft's.
|
||||
* The test also checks that the shim enabled XG's exclusive locking at device creation.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <d3d12.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
extern "C" __declspec(dllimport) HRESULT WINAPI D3D12XboxCreateDevice(PVOID adapter, const void* params, REFIID riid,
|
||||
void** ppv);
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int kRelease = 2, kDevGetResourceAllocationInfo = 25;
|
||||
int g_failed = 0;
|
||||
|
||||
template <typename Fn>
|
||||
Fn slot(void* object, int index) {
|
||||
return reinterpret_cast<Fn>((*static_cast<void* const* const*>(object))[index]);
|
||||
}
|
||||
using ReleaseFn = ULONG(STDMETHODCALLTYPE*)(void*);
|
||||
using AllocationInfoFn = D3D12_RESOURCE_ALLOCATION_INFO(STDMETHODCALLTYPE*)(void*, UINT, UINT, const D3D12_RESOURCE_DESC*);
|
||||
|
||||
D3D12_RESOURCE_DESC texture(UINT64 w, UINT h, UINT16 slices, DXGI_FORMAT format, UINT layout) {
|
||||
D3D12_RESOURCE_DESC d{};
|
||||
d.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
d.Width = w;
|
||||
d.Height = h;
|
||||
d.DepthOrArraySize = slices;
|
||||
d.MipLevels = 1;
|
||||
d.Format = format;
|
||||
d.SampleDesc.Count = 1;
|
||||
d.Layout = static_cast<D3D12_TEXTURE_LAYOUT>(layout);
|
||||
return d;
|
||||
}
|
||||
|
||||
// The stand-in library's answer (fake_xg.cpp), written out independently here.
|
||||
UINT64 fake_size(const D3D12_RESOURCE_DESC& d) {
|
||||
return d.Width * d.Height * d.DepthOrArraySize * 16ull + (static_cast<UINT>(d.Layout) & 0xFF) * 0x1000ull;
|
||||
}
|
||||
UINT64 fake_alignment(const D3D12_RESOURCE_DESC& d) { return static_cast<UINT>(d.Layout) == 0x109 ? 0x10000 : 0x1000; }
|
||||
|
||||
void expect(const char* what, UINT64 got, UINT64 want) {
|
||||
std::printf("%-52s got=0x%llx expected=0x%llx\n", what, static_cast<unsigned long long>(got),
|
||||
static_cast<unsigned long long>(want));
|
||||
if (got != want) {
|
||||
std::fprintf(stderr, "FAIL: test_d3d12_gdk_xg_sizes: %s\n", what);
|
||||
++g_failed;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
// Load the stand-in as xg_xs.dll before the device exists, as bx-cli stages the GDK's.
|
||||
wchar_t path[MAX_PATH];
|
||||
const DWORD n = GetModuleFileNameW(nullptr, path, MAX_PATH);
|
||||
wchar_t* slash = n ? wcsrchr(path, L'\\') : nullptr;
|
||||
if (!slash || wcslen(path) + 32 >= MAX_PATH) return 1;
|
||||
wcscpy(slash + 1, L"gdk_xg_fake\\xg_xs.dll");
|
||||
HMODULE fake = LoadLibraryW(path);
|
||||
if (!fake) {
|
||||
std::fprintf(stderr, "FAIL: test_d3d12_gdk_xg_sizes: the stand-in XG library did not load (error %lu)\n", GetLastError());
|
||||
return 1;
|
||||
}
|
||||
using LockingFn = LONG(__cdecl*)();
|
||||
auto locking = reinterpret_cast<LockingFn>(reinterpret_cast<void*>(GetProcAddress(fake, "FakeXGLockingEnabled")));
|
||||
|
||||
alignas(8) unsigned char title_params[80] = {};
|
||||
const UINT version = 0x20004; // a non-zero version selects the Xbox-layout device
|
||||
std::memcpy(title_params, &version, sizeof(version));
|
||||
void* dev = nullptr;
|
||||
HRESULT hr = D3D12XboxCreateDevice(nullptr, title_params, __uuidof(ID3D12Device), &dev);
|
||||
if (hr == E_NOINTERFACE) {
|
||||
std::printf("SKIP: test_d3d12_gdk_xg_sizes: host lacks the Xbox-layout device interface\n");
|
||||
return 77;
|
||||
}
|
||||
if (FAILED(hr) || !dev) {
|
||||
std::fprintf(stderr, "FAIL: device creation hr=0x%08lx\n", static_cast<unsigned long>(hr));
|
||||
return 1;
|
||||
}
|
||||
expect("XG exclusive locking enabled at device creation", locking ? static_cast<UINT64>(locking()) : 0, 1);
|
||||
|
||||
const auto info = slot<AllocationInfoFn>(dev, kDevGetResourceAllocationInfo);
|
||||
|
||||
// One console texture: XG's size and alignment.
|
||||
const D3D12_RESOURCE_DESC tiled = texture(128, 4, 1, DXGI_FORMAT_R16G16B16A16_UNORM, 0x105);
|
||||
D3D12_RESOURCE_ALLOCATION_INFO got = info(dev, 0, 1, &tiled);
|
||||
expect("128x4 RGBA16 layout 0x105: size", got.SizeInBytes, fake_size(tiled));
|
||||
expect("128x4 RGBA16 layout 0x105: alignment", got.Alignment, fake_alignment(tiled));
|
||||
|
||||
const D3D12_RESOURCE_DESC big = texture(256, 256, 6, DXGI_FORMAT_BC7_UNORM, 0x109);
|
||||
got = info(dev, 0, 1, &big);
|
||||
expect("256x256x6 BC7 layout 0x109: size", got.SizeInBytes, fake_size(big));
|
||||
expect("256x256x6 BC7 layout 0x109: alignment", got.Alignment, fake_alignment(big));
|
||||
|
||||
// A PC-layout texture keeps the host's answer.
|
||||
const D3D12_RESOURCE_DESC pc = texture(256, 256, 1, DXGI_FORMAT_R8G8B8A8_UNORM, D3D12_TEXTURE_LAYOUT_UNKNOWN);
|
||||
const D3D12_RESOURCE_ALLOCATION_INFO host = info(dev, 0, 1, &pc);
|
||||
expect("PC-layout texture: host size is answered", host.SizeInBytes != 0 && host.SizeInBytes != UINT64_MAX, 1);
|
||||
|
||||
// Console then PC texture: each at its alignment, in order; total alignment the largest.
|
||||
const D3D12_RESOURCE_DESC pair[2] = {tiled, pc};
|
||||
got = info(dev, 0, 2, pair);
|
||||
const UINT64 second = (fake_size(tiled) + host.Alignment - 1) / host.Alignment * host.Alignment;
|
||||
expect("console + PC texture: total size", got.SizeInBytes, second + host.SizeInBytes);
|
||||
expect("console + PC texture: total alignment", got.Alignment,
|
||||
host.Alignment > fake_alignment(tiled) ? host.Alignment : fake_alignment(tiled));
|
||||
|
||||
slot<ReleaseFn>(dev, kRelease)(dev);
|
||||
if (g_failed) return 1;
|
||||
std::puts("PASS: test_d3d12_gdk_xg_sizes");
|
||||
return 0;
|
||||
}
|
||||
@@ -31,16 +31,12 @@ __declspec(dllimport) VOID WINAPI XMemFree(PVOID address, uint64_t attributes);
|
||||
__declspec(dllimport) BOOL WINAPI XMemAllocatePhysicalPages(uint64_t flags, PULONG_PTR count, PULONG_PTR pages);
|
||||
__declspec(dllimport) BOOL WINAPI XMemFreePhysicalPages(ULONG_PTR count, PULONG_PTR pages);
|
||||
__declspec(dllimport) PVOID WINAPI XMemMapPhysicalPages(PVOID base, ULONG_PTR count, PULONG_PTR pages);
|
||||
__declspec(dllimport) BOOL WINAPI XMemGetWorkingSetStatistics(PVOID out_stats, SIZE_T stats_size);
|
||||
__declspec(dllimport) BOOL WINAPI XMemGetWorkingSetStatistics(DWORD flags, PVOID statistics);
|
||||
}
|
||||
|
||||
struct bx_xmem_stats_t {
|
||||
uint64_t title_limit_bytes;
|
||||
uint64_t committed_virtual_bytes;
|
||||
uint64_t allocated_physical_bytes;
|
||||
uint64_t peak_committed_bytes;
|
||||
};
|
||||
static_assert(sizeof(bx_xmem_stats_t) == 32, "xmem stats struct is 32 bytes");
|
||||
/* XMEM_WORKING_SET_TITLE; XMEM_WORKING_SET_STATISTICS is 120 bytes on x64 (authorized GDK header). */
|
||||
constexpr DWORD kXMemWorkingSetTitle = 0x20000001;
|
||||
constexpr size_t kXMemWorkingSetStatisticsSize = 120;
|
||||
|
||||
/* D3D12XboxCreateDevice requires a D3D12XBOX_CREATE_DEVICE_PARAMETERS block (80 bytes on Xbox
|
||||
Series); a zeroed one asks for defaults. Only its Version field is read by the shim. */
|
||||
@@ -515,8 +511,8 @@ void check_graphics_xmem_pairing(ID3D12Device* device, uint64_t cap) {
|
||||
return;
|
||||
}
|
||||
|
||||
bx_xmem_stats_t stats{};
|
||||
check(XMemGetWorkingSetStatistics(&stats, sizeof(stats)) != 0, "pairing: xmem stats readable");
|
||||
alignas(8) unsigned char stats[kXMemWorkingSetStatisticsSize]{};
|
||||
check(XMemGetWorkingSetStatistics(kXMemWorkingSetTitle, stats) != 0, "pairing: xmem stats readable");
|
||||
|
||||
/* 300 MiB heap + 300 MiB xmem = 600 MiB > 512 MiB cap. */
|
||||
void* too_much = XMemAlloc(300ull << 20, 0);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# #671: D3DMetal capability checks for translated console shaders (SM 6.6 heap indexing,
|
||||
# 64-lane wave emulation, amplification and mesh shaders). Loads the host d3d12.dll at run time;
|
||||
# links no BetterXen shim. Shader headers are generated by shaders/compile.sh (DXC v1.9.2609)
|
||||
# and committed.
|
||||
add_executable(test_d3dmetal_translator_caps main.cpp)
|
||||
target_include_directories(test_d3dmetal_translator_caps PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
target_link_libraries(test_d3dmetal_translator_caps PRIVATE kernel32)
|
||||
@@ -0,0 +1,763 @@
|
||||
/*
|
||||
* #671: what D3DMetal does with the features translated console shaders need. Each check
|
||||
* ends in one result line, "RESULT: <check> runs-correctly | workaround | blocked", with the
|
||||
* observations it rests on:
|
||||
*
|
||||
* 1. heap_index SM 6.6 dynamic resources: a UAV, a raw SRV, a typed SRV, a texture and a
|
||||
* sampler all fetched from the descriptor heaps by index. runs-correctly when
|
||||
* every value matches.
|
||||
* 2. wave64 A 64-lane console wave on host hardware: the host's wave width, then two
|
||||
* routes over a 64-thread group, through groupshared memory and through the
|
||||
* host's own wave operations merged across waves (ballot, prefix sum, read
|
||||
* lane, active sum). workaround when a route gives the 64-lane answers; the
|
||||
* [WaveSize(64)] attribute itself is measured by test_d3dmetal_gpu_limits.
|
||||
* 3. atomic64 Measured by test_d3dmetal_gpu_limits (typed 64-bit atomics, lock emulation);
|
||||
* not repeated here.
|
||||
* 4. mesh Amplification -> mesh -> pixel into a 4x4 target: the reported mesh shader
|
||||
* tier, pipeline creation, and every pixel's value.
|
||||
*
|
||||
* Talks to the host d3d12.dll directly (no BetterXen shim in the path), so under
|
||||
* CrossOver/Wine with D3DMetal it measures D3DMetal. Expected values are computed here on
|
||||
* the CPU from the public HLSL/D3D12 semantics, never by the GPU.
|
||||
*
|
||||
* A check whose result is not runs-correctly is an observation, not a failure: the test exits
|
||||
* 0 when every result was reached, 1 when setup failed or the GPU hung, 77 without SM 6.6.
|
||||
*/
|
||||
#ifndef WIDL_EXPLICIT_AGGREGATE_RETURNS
|
||||
#define WIDL_EXPLICIT_AGGREGATE_RETURNS /* call struct-returning COM methods with the real x64 ABI */
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <d3d12.h>
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include "shaders/heap_index.h"
|
||||
#include "shaders/mesh_as.h"
|
||||
#include "shaders/mesh_ms.h"
|
||||
#include "shaders/mesh_ps.h"
|
||||
#include "shaders/wave64_emulation.h"
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr uint32_t kSentinel = 0xA5A5A5A5u;
|
||||
constexpr DWORD kGpuTimeoutMs = 10000;
|
||||
int g_required = 0;
|
||||
int g_failures = 0;
|
||||
|
||||
__attribute__((format(gnu_printf, 2, 3)))
|
||||
bool require(bool ok, const char* fmt, ...) {
|
||||
g_required++;
|
||||
if (!ok) {
|
||||
g_failures++;
|
||||
char msg[320];
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
std::vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||
va_end(ap);
|
||||
std::fprintf(stderr, "FAIL: %s\n", msg);
|
||||
std::fflush(stderr);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
__attribute__((format(gnu_printf, 1, 2)))
|
||||
void observed(const char* fmt, ...) {
|
||||
char msg[320];
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
std::vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||
va_end(ap);
|
||||
std::printf("OBSERVED: %s\n", msg);
|
||||
std::fflush(stdout);
|
||||
}
|
||||
|
||||
unsigned long ul(HRESULT hr) { return static_cast<unsigned long>(hr); }
|
||||
|
||||
template <typename T>
|
||||
void release(T*& p) {
|
||||
if (p) {
|
||||
p->Release();
|
||||
p = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- D3D12 plumbing ---- */
|
||||
|
||||
using PFN_CreateDevice = HRESULT(WINAPI*)(IUnknown*, D3D_FEATURE_LEVEL, REFIID, void**);
|
||||
using PFN_Serialize = HRESULT(WINAPI*)(const D3D12_ROOT_SIGNATURE_DESC*, D3D_ROOT_SIGNATURE_VERSION, ID3DBlob**,
|
||||
ID3DBlob**);
|
||||
|
||||
struct Gpu {
|
||||
ID3D12Device* dev = nullptr;
|
||||
ID3D12CommandQueue* queue = nullptr;
|
||||
ID3D12CommandAllocator* alloc = nullptr;
|
||||
ID3D12GraphicsCommandList* list = nullptr;
|
||||
ID3D12Fence* fence = nullptr;
|
||||
UINT64 fence_value = 0;
|
||||
HANDLE event = nullptr;
|
||||
PFN_Serialize serialize = nullptr;
|
||||
bool lost = false; /* a submission timed out or the device was removed */
|
||||
};
|
||||
|
||||
/* Close, submit, wait (bounded) and reopen the list. False on timeout or device removal. */
|
||||
bool submit(Gpu& g, const char* what) {
|
||||
if (g.lost) return false;
|
||||
HRESULT hr = g.list->Close();
|
||||
if (FAILED(hr)) {
|
||||
observed("%s command list Close failed hr=0x%08lx", what, ul(hr));
|
||||
return false;
|
||||
}
|
||||
ID3D12CommandList* lists[] = {g.list};
|
||||
g.queue->ExecuteCommandLists(1, lists);
|
||||
hr = g.queue->Signal(g.fence, ++g.fence_value);
|
||||
if (FAILED(hr)) {
|
||||
observed("%s queue Signal failed hr=0x%08lx", what, ul(hr));
|
||||
g.lost = true;
|
||||
return false;
|
||||
}
|
||||
if (g.fence->GetCompletedValue() < g.fence_value) {
|
||||
hr = g.fence->SetEventOnCompletion(g.fence_value, g.event);
|
||||
if (FAILED(hr) || WaitForSingleObject(g.event, kGpuTimeoutMs) != WAIT_OBJECT_0) {
|
||||
observed("%s GPU work did not finish within %lu ms (queue considered hung; later checks skipped)", what,
|
||||
static_cast<unsigned long>(kGpuTimeoutMs));
|
||||
g.lost = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (g.fence->GetCompletedValue() == UINT64_MAX) {
|
||||
observed("%s device removed, reason hr=0x%08lx", what, ul(g.dev->GetDeviceRemovedReason()));
|
||||
g.lost = true;
|
||||
return false;
|
||||
}
|
||||
hr = g.alloc->Reset();
|
||||
if (SUCCEEDED(hr)) hr = g.list->Reset(g.alloc, nullptr);
|
||||
if (FAILED(hr)) {
|
||||
observed("%s allocator or command list Reset failed hr=0x%08lx", what, ul(hr));
|
||||
g.lost = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Discards whatever is recorded in the open list without executing it (used when a
|
||||
* check fails partway through recording), so the next check starts from an empty list. */
|
||||
void abandon(Gpu& g) {
|
||||
if (g.lost) return;
|
||||
g.list->Close();
|
||||
if (FAILED(g.alloc->Reset()) || FAILED(g.list->Reset(g.alloc, nullptr))) g.lost = true;
|
||||
}
|
||||
|
||||
/* Releases a resource the GPU may have used. After a hung or removed queue the GPU may
|
||||
* still reference it, so it is deliberately leaked instead. */
|
||||
template <typename T>
|
||||
void drop(const Gpu& g, T*& p) {
|
||||
if (g.lost) {
|
||||
p = nullptr;
|
||||
return;
|
||||
}
|
||||
release(p);
|
||||
}
|
||||
|
||||
ID3D12Resource* make_buffer(Gpu& g, D3D12_HEAP_TYPE heap, UINT64 size, D3D12_RESOURCE_STATES state,
|
||||
D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE) {
|
||||
D3D12_HEAP_PROPERTIES hp = {};
|
||||
hp.Type = heap;
|
||||
D3D12_RESOURCE_DESC rd = {};
|
||||
rd.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
|
||||
rd.Width = size;
|
||||
rd.Height = 1;
|
||||
rd.DepthOrArraySize = 1;
|
||||
rd.MipLevels = 1;
|
||||
rd.SampleDesc.Count = 1;
|
||||
rd.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
|
||||
rd.Flags = flags;
|
||||
ID3D12Resource* r = nullptr;
|
||||
HRESULT hr = g.dev->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &rd, state, nullptr,
|
||||
__uuidof(ID3D12Resource), reinterpret_cast<void**>(&r));
|
||||
return SUCCEEDED(hr) ? r : nullptr;
|
||||
}
|
||||
|
||||
ID3D12Resource* make_texture(Gpu& g, UINT width, UINT height, DXGI_FORMAT format) {
|
||||
D3D12_HEAP_PROPERTIES hp = {};
|
||||
hp.Type = D3D12_HEAP_TYPE_DEFAULT;
|
||||
D3D12_RESOURCE_DESC rd = {};
|
||||
rd.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
rd.Width = width;
|
||||
rd.Height = height;
|
||||
rd.DepthOrArraySize = 1;
|
||||
rd.MipLevels = 1;
|
||||
rd.Format = format;
|
||||
rd.SampleDesc.Count = 1;
|
||||
rd.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
|
||||
ID3D12Resource* r = nullptr;
|
||||
HRESULT hr = g.dev->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &rd, D3D12_RESOURCE_STATE_COPY_DEST,
|
||||
nullptr, __uuidof(ID3D12Resource), reinterpret_cast<void**>(&r));
|
||||
return SUCCEEDED(hr) ? r : nullptr;
|
||||
}
|
||||
|
||||
void transition(Gpu& g, ID3D12Resource* r, D3D12_RESOURCE_STATES before, D3D12_RESOURCE_STATES after) {
|
||||
D3D12_RESOURCE_BARRIER b = {};
|
||||
b.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
|
||||
b.Transition.pResource = r;
|
||||
b.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
|
||||
b.Transition.StateBefore = before;
|
||||
b.Transition.StateAfter = after;
|
||||
g.list->ResourceBarrier(1, &b);
|
||||
}
|
||||
|
||||
bool map_write(ID3D12Resource* r, const void* src, size_t n) {
|
||||
void* p = nullptr;
|
||||
if (FAILED(r->Map(0, nullptr, &p)) || !p) return false;
|
||||
std::memcpy(p, src, n);
|
||||
r->Unmap(0, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool map_read(ID3D12Resource* r, void* dst, size_t n) {
|
||||
void* p = nullptr;
|
||||
D3D12_RANGE range = {0, n};
|
||||
if (FAILED(r->Map(0, &range, &p)) || !p) return false;
|
||||
std::memcpy(dst, p, n);
|
||||
D3D12_RANGE none = {0, 0};
|
||||
r->Unmap(0, &none);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Root signature from parameters; logs and returns null on failure. */
|
||||
ID3D12RootSignature* make_root(Gpu& g, const char* what, const D3D12_ROOT_PARAMETER* params, UINT count) {
|
||||
D3D12_ROOT_SIGNATURE_DESC desc = {};
|
||||
desc.NumParameters = count;
|
||||
desc.pParameters = params;
|
||||
ID3DBlob* blob = nullptr;
|
||||
ID3DBlob* err = nullptr;
|
||||
HRESULT hr = g.serialize(&desc, D3D_ROOT_SIGNATURE_VERSION_1, &blob, &err);
|
||||
release(err);
|
||||
if (FAILED(hr)) {
|
||||
observed("%s root signature serialization failed hr=0x%08lx", what, ul(hr));
|
||||
return nullptr;
|
||||
}
|
||||
ID3D12RootSignature* rs = nullptr;
|
||||
hr = g.dev->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(), __uuidof(ID3D12RootSignature),
|
||||
reinterpret_cast<void**>(&rs));
|
||||
release(blob);
|
||||
if (FAILED(hr)) {
|
||||
observed("%s CreateRootSignature failed hr=0x%08lx", what, ul(hr));
|
||||
return nullptr;
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
ID3D12PipelineState* make_pipeline(Gpu& g, ID3D12RootSignature* rs, const unsigned char* code, size_t size,
|
||||
HRESULT* out_hr) {
|
||||
D3D12_COMPUTE_PIPELINE_STATE_DESC pd = {};
|
||||
pd.pRootSignature = rs;
|
||||
pd.CS.pShaderBytecode = code;
|
||||
pd.CS.BytecodeLength = size;
|
||||
ID3D12PipelineState* pso = nullptr;
|
||||
*out_hr = g.dev->CreateComputePipelineState(&pd, __uuidof(ID3D12PipelineState), reinterpret_cast<void**>(&pso));
|
||||
return SUCCEEDED(*out_hr) ? pso : nullptr;
|
||||
}
|
||||
|
||||
D3D12_ROOT_PARAMETER root_uav(UINT reg) {
|
||||
D3D12_ROOT_PARAMETER p = {};
|
||||
p.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV;
|
||||
p.Descriptor.ShaderRegister = reg;
|
||||
p.ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
|
||||
return p;
|
||||
}
|
||||
|
||||
/* ---- buffer kernels: run one dispatch over a root-UAV buffer, return its words ---- */
|
||||
|
||||
bool run_buffer_kernel(Gpu& g, const char* what, ID3D12PipelineState* pso, ID3D12RootSignature* rs,
|
||||
const std::vector<uint32_t>& init, UINT groups, std::vector<uint32_t>& out) {
|
||||
const UINT64 bytes = init.size() * sizeof(uint32_t);
|
||||
ID3D12Resource* up = make_buffer(g, D3D12_HEAP_TYPE_UPLOAD, bytes, D3D12_RESOURCE_STATE_GENERIC_READ);
|
||||
ID3D12Resource* buf = make_buffer(g, D3D12_HEAP_TYPE_DEFAULT, bytes, D3D12_RESOURCE_STATE_COMMON,
|
||||
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS);
|
||||
ID3D12Resource* rb = make_buffer(g, D3D12_HEAP_TYPE_READBACK, bytes, D3D12_RESOURCE_STATE_COPY_DEST);
|
||||
bool ok = up && buf && rb && map_write(up, init.data(), bytes);
|
||||
if (ok) {
|
||||
g.list->CopyBufferRegion(buf, 0, up, 0, bytes);
|
||||
transition(g, buf, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
g.list->SetComputeRootSignature(rs);
|
||||
g.list->SetPipelineState(pso);
|
||||
g.list->SetComputeRootUnorderedAccessView(0, buf->GetGPUVirtualAddress());
|
||||
g.list->Dispatch(groups, 1, 1);
|
||||
transition(g, buf, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
g.list->CopyBufferRegion(rb, 0, buf, 0, bytes);
|
||||
ok = submit(g, what);
|
||||
out.assign(init.size(), 0);
|
||||
ok = ok && map_read(rb, out.data(), bytes);
|
||||
} else {
|
||||
observed("%s buffer creation or upload failed", what);
|
||||
}
|
||||
drop(g, up);
|
||||
drop(g, buf);
|
||||
drop(g, rb);
|
||||
return ok;
|
||||
}
|
||||
|
||||
struct TexCopy {
|
||||
D3D12_PLACED_SUBRESOURCE_FOOTPRINT fp = {};
|
||||
UINT64 total = 0;
|
||||
};
|
||||
|
||||
TexCopy footprint(Gpu& g, ID3D12Resource* tex) {
|
||||
TexCopy t;
|
||||
D3D12_RESOURCE_DESC rd;
|
||||
tex->GetDesc(&rd);
|
||||
UINT rows = 0;
|
||||
UINT64 row_bytes = 0;
|
||||
g.dev->GetCopyableFootprints(&rd, 0, 1, 0, &t.fp, &rows, &row_bytes, &t.total);
|
||||
return t;
|
||||
}
|
||||
|
||||
void copy_to_texture(Gpu& g, ID3D12Resource* tex, ID3D12Resource* up, const TexCopy& t) {
|
||||
D3D12_TEXTURE_COPY_LOCATION dst = {};
|
||||
dst.pResource = tex;
|
||||
dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
|
||||
D3D12_TEXTURE_COPY_LOCATION src = {};
|
||||
src.pResource = up;
|
||||
src.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
|
||||
src.PlacedFootprint = t.fp;
|
||||
g.list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
|
||||
}
|
||||
|
||||
|
||||
void result(const char* check, const char* outcome, const char* why) {
|
||||
std::printf("RESULT: %s %s (%s)\n", check, outcome, why);
|
||||
}
|
||||
|
||||
ID3D12RootSignature* make_root_flags(Gpu& g, const char* what, const D3D12_ROOT_PARAMETER* params, UINT count,
|
||||
D3D12_ROOT_SIGNATURE_FLAGS flags) {
|
||||
D3D12_ROOT_SIGNATURE_DESC desc = {};
|
||||
desc.NumParameters = count;
|
||||
desc.pParameters = params;
|
||||
desc.Flags = flags;
|
||||
ID3DBlob* blob = nullptr;
|
||||
ID3DBlob* err = nullptr;
|
||||
HRESULT hr = g.serialize(&desc, D3D_ROOT_SIGNATURE_VERSION_1, &blob, &err);
|
||||
if (FAILED(hr)) {
|
||||
observed("%s root signature serialization failed hr=0x%08lx %s", what, ul(hr),
|
||||
err ? static_cast<const char*>(err->GetBufferPointer()) : "");
|
||||
release(err);
|
||||
return nullptr;
|
||||
}
|
||||
release(err);
|
||||
ID3D12RootSignature* rs = nullptr;
|
||||
hr = g.dev->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(), __uuidof(ID3D12RootSignature),
|
||||
reinterpret_cast<void**>(&rs));
|
||||
release(blob);
|
||||
if (FAILED(hr)) observed("%s CreateRootSignature failed hr=0x%08lx", what, ul(hr));
|
||||
return SUCCEEDED(hr) ? rs : nullptr;
|
||||
}
|
||||
|
||||
/* ---- 1. heap_index ---- */
|
||||
|
||||
void check_heap_index(Gpu& g) {
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS o = {};
|
||||
if (SUCCEEDED(g.dev->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &o, sizeof(o)))) {
|
||||
observed("heap_index.resource_binding_tier %d", static_cast<int>(o.ResourceBindingTier));
|
||||
}
|
||||
D3D12_ROOT_PARAMETER constants = {};
|
||||
constants.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
|
||||
constants.Constants.ShaderRegister = 0;
|
||||
constants.Constants.Num32BitValues = 4;
|
||||
constants.ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
|
||||
const auto flags = static_cast<D3D12_ROOT_SIGNATURE_FLAGS>(0x400 | 0x800); /* CBV_SRV_UAV_ and SAMPLER_HEAP_DIRECTLY_INDEXED */
|
||||
ID3D12RootSignature* rs = make_root_flags(g, "heap_index", &constants, 1, flags);
|
||||
if (!rs) {
|
||||
result("heap_index", "blocked", "root signature with directly indexed heaps refused");
|
||||
return;
|
||||
}
|
||||
HRESULT hr = S_OK;
|
||||
ID3D12PipelineState* pso = make_pipeline(g, rs, g_heap_index_cs, sizeof(g_heap_index_cs), &hr);
|
||||
if (!pso) {
|
||||
observed("heap_index CreateComputePipelineState hr=0x%08lx", ul(hr));
|
||||
result("heap_index", "blocked", "pipeline refused");
|
||||
release(rs);
|
||||
return;
|
||||
}
|
||||
|
||||
constexpr UINT kN = 64;
|
||||
std::vector<uint32_t> raw(kN), typed(kN);
|
||||
for (UINT i = 0; i < kN; ++i) {
|
||||
raw[i] = i * 5u + 1u;
|
||||
typed[i] = 1000u + i;
|
||||
}
|
||||
const float texels[4] = {1.0f, 2.5f, 3.0f, 4.0f}; /* 2x2, row-major; texel (1,0) is 2.5 */
|
||||
const UINT64 out_bytes = (kN + 1) * 4;
|
||||
ID3D12Resource* raw_up = make_buffer(g, D3D12_HEAP_TYPE_UPLOAD, kN * 4, D3D12_RESOURCE_STATE_GENERIC_READ);
|
||||
ID3D12Resource* typed_up = make_buffer(g, D3D12_HEAP_TYPE_UPLOAD, kN * 4, D3D12_RESOURCE_STATE_GENERIC_READ);
|
||||
ID3D12Resource* outb = make_buffer(g, D3D12_HEAP_TYPE_DEFAULT, out_bytes, D3D12_RESOURCE_STATE_COMMON,
|
||||
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS);
|
||||
ID3D12Resource* rb = make_buffer(g, D3D12_HEAP_TYPE_READBACK, out_bytes, D3D12_RESOURCE_STATE_COPY_DEST);
|
||||
ID3D12Resource* tex = make_texture(g, 2, 2, DXGI_FORMAT_R32_FLOAT);
|
||||
TexCopy tc;
|
||||
ID3D12Resource* tex_up = nullptr;
|
||||
if (tex) {
|
||||
tc = footprint(g, tex);
|
||||
tex_up = make_buffer(g, D3D12_HEAP_TYPE_UPLOAD, tc.total, D3D12_RESOURCE_STATE_GENERIC_READ);
|
||||
}
|
||||
bool ok = raw_up && typed_up && outb && rb && tex && tex_up && map_write(raw_up, raw.data(), kN * 4) &&
|
||||
map_write(typed_up, typed.data(), kN * 4);
|
||||
if (ok) {
|
||||
std::vector<uint8_t> staging(tc.total, 0);
|
||||
for (UINT y = 0; y < 2; ++y) std::memcpy(&staging[tc.fp.Offset + y * tc.fp.Footprint.RowPitch], &texels[y * 2], 8);
|
||||
ok = map_write(tex_up, staging.data(), staging.size());
|
||||
}
|
||||
ID3D12DescriptorHeap* heap = nullptr;
|
||||
ID3D12DescriptorHeap* samplers = nullptr;
|
||||
if (ok) {
|
||||
D3D12_DESCRIPTOR_HEAP_DESC hd = {};
|
||||
hd.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
|
||||
hd.NumDescriptors = 4;
|
||||
hd.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
|
||||
D3D12_DESCRIPTOR_HEAP_DESC sd = hd;
|
||||
sd.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER;
|
||||
sd.NumDescriptors = 1;
|
||||
ok = SUCCEEDED(g.dev->CreateDescriptorHeap(&hd, __uuidof(ID3D12DescriptorHeap), reinterpret_cast<void**>(&heap))) &&
|
||||
SUCCEEDED(g.dev->CreateDescriptorHeap(&sd, __uuidof(ID3D12DescriptorHeap), reinterpret_cast<void**>(&samplers)));
|
||||
}
|
||||
if (ok) {
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE h;
|
||||
heap->GetCPUDescriptorHandleForHeapStart(&h);
|
||||
const UINT inc = g.dev->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
|
||||
D3D12_UNORDERED_ACCESS_VIEW_DESC ud = {};
|
||||
ud.ViewDimension = D3D12_UAV_DIMENSION_BUFFER;
|
||||
ud.Buffer.NumElements = kN + 1;
|
||||
ud.Buffer.StructureByteStride = 4;
|
||||
g.dev->CreateUnorderedAccessView(outb, nullptr, &ud, h);
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC rd = {};
|
||||
rd.ViewDimension = D3D12_SRV_DIMENSION_BUFFER;
|
||||
rd.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
||||
rd.Format = DXGI_FORMAT_R32_TYPELESS;
|
||||
rd.Buffer.NumElements = kN;
|
||||
rd.Buffer.Flags = D3D12_BUFFER_SRV_FLAG_RAW;
|
||||
h.ptr += inc;
|
||||
g.dev->CreateShaderResourceView(raw_up, &rd, h);
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC td = rd;
|
||||
td.Format = DXGI_FORMAT_R32_UINT;
|
||||
td.Buffer.Flags = D3D12_BUFFER_SRV_FLAG_NONE;
|
||||
h.ptr += inc;
|
||||
g.dev->CreateShaderResourceView(typed_up, &td, h);
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC xd = {};
|
||||
xd.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
|
||||
xd.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
||||
xd.Format = DXGI_FORMAT_R32_FLOAT;
|
||||
xd.Texture2D.MipLevels = 1;
|
||||
h.ptr += inc;
|
||||
g.dev->CreateShaderResourceView(tex, &xd, h);
|
||||
D3D12_SAMPLER_DESC smp = {};
|
||||
smp.Filter = D3D12_FILTER_MIN_MAG_MIP_POINT;
|
||||
smp.AddressU = smp.AddressV = smp.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
|
||||
smp.MaxLOD = 1000.0f;
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE sh;
|
||||
samplers->GetCPUDescriptorHandleForHeapStart(&sh);
|
||||
g.dev->CreateSampler(&smp, sh);
|
||||
|
||||
copy_to_texture(g, tex, tex_up, tc);
|
||||
transition(g, tex, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
|
||||
transition(g, outb, D3D12_RESOURCE_STATE_COMMON, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
|
||||
ID3D12DescriptorHeap* heaps[] = {heap, samplers};
|
||||
g.list->SetDescriptorHeaps(2, heaps);
|
||||
g.list->SetComputeRootSignature(rs);
|
||||
g.list->SetPipelineState(pso);
|
||||
const UINT indices[4] = {0, 1, 2, 3};
|
||||
g.list->SetComputeRoot32BitConstants(0, 4, indices, 0);
|
||||
g.list->Dispatch(1, 1, 1);
|
||||
transition(g, outb, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
g.list->CopyBufferRegion(rb, 0, outb, 0, out_bytes);
|
||||
ok = submit(g, "heap_index");
|
||||
} else {
|
||||
observed("heap_index setup failed");
|
||||
abandon(g);
|
||||
}
|
||||
std::vector<uint32_t> out(kN + 1, kSentinel);
|
||||
if (ok) ok = map_read(rb, out.data(), out_bytes);
|
||||
if (!ok) {
|
||||
require(false, "heap_index: setup and GPU work must complete");
|
||||
} else {
|
||||
UINT wrong = 0;
|
||||
for (UINT i = 0; i < kN; ++i) wrong += out[i] != raw[i] * 3u + typed[i];
|
||||
float sampled = 0;
|
||||
std::memcpy(&sampled, &out[kN], 4);
|
||||
observed("heap_index buffers: %u of %u words wrong; first word 0x%08x (expected 0x%08x)", wrong, kN, out[0],
|
||||
raw[0] * 3u + typed[0]);
|
||||
observed("heap_index sampler+texture: got %g (expected 2.5)", static_cast<double>(sampled));
|
||||
const bool all = wrong == 0 && sampled == 2.5f;
|
||||
result("heap_index", all ? "runs-correctly" : "blocked",
|
||||
all ? "UAV, raw and typed SRVs, texture and sampler all fetched by heap index"
|
||||
: "values from heap-indexed descriptors are wrong");
|
||||
}
|
||||
drop(g, raw_up);
|
||||
drop(g, typed_up);
|
||||
drop(g, outb);
|
||||
drop(g, rb);
|
||||
drop(g, tex);
|
||||
drop(g, tex_up);
|
||||
drop(g, heap);
|
||||
drop(g, samplers);
|
||||
release(pso);
|
||||
release(rs);
|
||||
}
|
||||
|
||||
/* ---- 2. wave64 ---- */
|
||||
|
||||
uint32_t value_of(uint32_t lane) { return (lane * 7u + 3u) & 31u; }
|
||||
bool pred_of(uint32_t lane) { return ((lane * 13u + 5u) % 3u) == 0u; }
|
||||
|
||||
void check_wave64(Gpu& g) {
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS1 o1 = {};
|
||||
if (SUCCEEDED(g.dev->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &o1, sizeof(o1)))) {
|
||||
observed("wave64.reported WaveOps=%d WaveLaneCountMin=%u WaveLaneCountMax=%u", o1.WaveOps ? 1 : 0,
|
||||
o1.WaveLaneCountMin, o1.WaveLaneCountMax);
|
||||
}
|
||||
D3D12_ROOT_PARAMETER params[] = {root_uav(0)};
|
||||
ID3D12RootSignature* rs = make_root(g, "wave64", params, 1);
|
||||
if (!require(rs != nullptr, "wave64 root signature")) return;
|
||||
HRESULT hr = S_OK;
|
||||
ID3D12PipelineState* pso = make_pipeline(g, rs, g_wave64_emulation_cs, sizeof(g_wave64_emulation_cs), &hr);
|
||||
if (!pso) {
|
||||
observed("wave64 CreateComputePipelineState hr=0x%08lx", ul(hr));
|
||||
result("wave64", "blocked", "emulation kernel refused");
|
||||
release(rs);
|
||||
return;
|
||||
}
|
||||
std::vector<uint32_t> out;
|
||||
const bool ran = run_buffer_kernel(g, "wave64", pso, rs, std::vector<uint32_t>(64 * 8, kSentinel), 1, out);
|
||||
release(pso);
|
||||
release(rs);
|
||||
if (!require(ran, "wave64: dispatch must complete")) return;
|
||||
|
||||
/* CPU reference for a 64-lane wave. */
|
||||
uint32_t lo = 0, hi = 0, total = 0;
|
||||
for (uint32_t i = 0; i < 64; ++i) {
|
||||
if (pred_of(i)) (i < 32 ? lo : hi) |= 1u << (i & 31u);
|
||||
total += value_of(i);
|
||||
}
|
||||
UINT shared_wrong = 0, native_wrong = 0;
|
||||
uint32_t prefix = 0;
|
||||
for (uint32_t lane = 0; lane < 64; ++lane) {
|
||||
const uint32_t* o = &out[lane * 8];
|
||||
shared_wrong += o[0] != lo || o[1] != hi || o[2] != prefix || o[3] != value_of(37) || o[4] != total;
|
||||
native_wrong += o[5] != lo || o[6] != hi || o[7] != prefix;
|
||||
prefix += value_of(lane);
|
||||
}
|
||||
observed("wave64 shared route: %u of 64 lanes wrong", shared_wrong);
|
||||
observed("wave64 native route: %u of 64 lanes wrong (ballot 0x%08x%08x, expected 0x%08x%08x)", native_wrong, out[6],
|
||||
out[5], hi, lo);
|
||||
if (shared_wrong == 0 && native_wrong == 0) {
|
||||
result("wave64", "workaround", "64-lane ballot, prefix sum, read lane and sum correct through groupshared memory and through merged host waves");
|
||||
} else if (shared_wrong == 0) {
|
||||
result("wave64", "workaround", "groupshared route correct; merged host waves wrong");
|
||||
} else {
|
||||
result("wave64", "blocked", "no route gave the 64-lane answers");
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- 4. mesh ---- */
|
||||
|
||||
struct alignas(void*) StreamRootSig { D3D12_PIPELINE_STATE_SUBOBJECT_TYPE type = D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE; ID3D12RootSignature* rs; };
|
||||
struct alignas(void*) StreamShader { D3D12_PIPELINE_STATE_SUBOBJECT_TYPE type; D3D12_SHADER_BYTECODE code; };
|
||||
struct alignas(void*) StreamRtFormats { D3D12_PIPELINE_STATE_SUBOBJECT_TYPE type = D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS; D3D12_RT_FORMAT_ARRAY formats; };
|
||||
struct alignas(void*) StreamRasterizer { D3D12_PIPELINE_STATE_SUBOBJECT_TYPE type = D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER; D3D12_RASTERIZER_DESC desc; };
|
||||
struct MeshStream {
|
||||
StreamRootSig rs;
|
||||
StreamShader as{D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS, {}};
|
||||
StreamShader ms{D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS, {}};
|
||||
StreamShader ps{D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS, {}};
|
||||
StreamRtFormats rt;
|
||||
StreamRasterizer raster;
|
||||
};
|
||||
|
||||
void check_mesh(Gpu& g) {
|
||||
D3D12_FEATURE_DATA_D3D12_OPTIONS7 o7 = {};
|
||||
const HRESULT qhr = g.dev->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &o7, sizeof(o7));
|
||||
observed("mesh.reported query hr=0x%08lx MeshShaderTier=%d", ul(qhr), SUCCEEDED(qhr) ? static_cast<int>(o7.MeshShaderTier) : -1);
|
||||
|
||||
ID3D12Device2* dev2 = nullptr;
|
||||
ID3D12GraphicsCommandList6* list6 = nullptr;
|
||||
g.dev->QueryInterface(__uuidof(ID3D12Device2), reinterpret_cast<void**>(&dev2));
|
||||
g.list->QueryInterface(__uuidof(ID3D12GraphicsCommandList6), reinterpret_cast<void**>(&list6));
|
||||
observed("mesh.interfaces ID3D12Device2=%d ID3D12GraphicsCommandList6=%d", dev2 ? 1 : 0, list6 ? 1 : 0);
|
||||
ID3D12RootSignature* rs = make_root(g, "mesh", nullptr, 0);
|
||||
ID3D12PipelineState* pso = nullptr;
|
||||
HRESULT hr = E_NOINTERFACE;
|
||||
if (dev2 && rs) {
|
||||
MeshStream s;
|
||||
s.rs.rs = rs;
|
||||
s.as.code = {g_mesh_as, sizeof(g_mesh_as)};
|
||||
s.ms.code = {g_mesh_ms, sizeof(g_mesh_ms)};
|
||||
s.ps.code = {g_mesh_ps, sizeof(g_mesh_ps)};
|
||||
s.rt.formats.NumRenderTargets = 1;
|
||||
s.rt.formats.RTFormats[0] = DXGI_FORMAT_R32_UINT;
|
||||
s.raster.desc.FillMode = D3D12_FILL_MODE_SOLID;
|
||||
s.raster.desc.CullMode = D3D12_CULL_MODE_NONE;
|
||||
s.raster.desc.DepthClipEnable = TRUE;
|
||||
D3D12_PIPELINE_STATE_STREAM_DESC sd = {sizeof(s), &s};
|
||||
hr = dev2->CreatePipelineState(&sd, __uuidof(ID3D12PipelineState), reinterpret_cast<void**>(&pso));
|
||||
}
|
||||
observed("mesh.pipeline CreatePipelineState hr=0x%08lx", ul(hr));
|
||||
if (!pso || !list6) {
|
||||
result("mesh", "blocked",
|
||||
SUCCEEDED(qhr) && o7.MeshShaderTier == D3D12_MESH_SHADER_TIER_NOT_SUPPORTED
|
||||
? "mesh shader tier not supported and the amplification+mesh pipeline is refused"
|
||||
: "the amplification+mesh pipeline is refused");
|
||||
release(pso);
|
||||
release(rs);
|
||||
release(list6);
|
||||
release(dev2);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 4x4 R32_UINT target; group 0 covers the lower-left half, group 1 the upper-right. */
|
||||
D3D12_HEAP_PROPERTIES hp = {};
|
||||
hp.Type = D3D12_HEAP_TYPE_DEFAULT;
|
||||
D3D12_RESOURCE_DESC rd = {};
|
||||
rd.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
|
||||
rd.Width = 4;
|
||||
rd.Height = 4;
|
||||
rd.DepthOrArraySize = 1;
|
||||
rd.MipLevels = 1;
|
||||
rd.Format = DXGI_FORMAT_R32_UINT;
|
||||
rd.SampleDesc.Count = 1;
|
||||
rd.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
|
||||
D3D12_CLEAR_VALUE cv = {};
|
||||
cv.Format = DXGI_FORMAT_R32_UINT;
|
||||
ID3D12Resource* target = nullptr;
|
||||
g.dev->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &rd, D3D12_RESOURCE_STATE_RENDER_TARGET, &cv,
|
||||
__uuidof(ID3D12Resource), reinterpret_cast<void**>(&target));
|
||||
ID3D12DescriptorHeap* rtv = nullptr;
|
||||
D3D12_DESCRIPTOR_HEAP_DESC hd = {};
|
||||
hd.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
|
||||
hd.NumDescriptors = 1;
|
||||
g.dev->CreateDescriptorHeap(&hd, __uuidof(ID3D12DescriptorHeap), reinterpret_cast<void**>(&rtv));
|
||||
TexCopy tc;
|
||||
ID3D12Resource* rb = nullptr;
|
||||
if (target) {
|
||||
tc = footprint(g, target);
|
||||
rb = make_buffer(g, D3D12_HEAP_TYPE_READBACK, tc.total, D3D12_RESOURCE_STATE_COPY_DEST);
|
||||
}
|
||||
bool ok = target && rtv && rb;
|
||||
if (ok) {
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE h;
|
||||
rtv->GetCPUDescriptorHandleForHeapStart(&h);
|
||||
g.dev->CreateRenderTargetView(target, nullptr, h);
|
||||
const float clear[4] = {0, 0, 0, 0};
|
||||
g.list->ClearRenderTargetView(h, clear, 0, nullptr);
|
||||
g.list->OMSetRenderTargets(1, &h, FALSE, nullptr);
|
||||
D3D12_VIEWPORT vp = {0, 0, 4, 4, 0, 1};
|
||||
D3D12_RECT sc = {0, 0, 4, 4};
|
||||
g.list->RSSetViewports(1, &vp);
|
||||
g.list->RSSetScissorRects(1, &sc);
|
||||
g.list->SetGraphicsRootSignature(rs);
|
||||
g.list->SetPipelineState(pso);
|
||||
list6->DispatchMesh(1, 1, 1);
|
||||
transition(g, target, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
D3D12_TEXTURE_COPY_LOCATION dst = {};
|
||||
dst.pResource = rb;
|
||||
dst.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
|
||||
dst.PlacedFootprint = tc.fp;
|
||||
D3D12_TEXTURE_COPY_LOCATION src = {};
|
||||
src.pResource = target;
|
||||
src.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
|
||||
g.list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
|
||||
ok = submit(g, "mesh");
|
||||
} else {
|
||||
observed("mesh render target setup failed");
|
||||
abandon(g);
|
||||
}
|
||||
std::vector<uint8_t> data(tc.total, 0);
|
||||
if (ok) ok = map_read(rb, data.data(), data.size());
|
||||
if (!ok) {
|
||||
require(false, "mesh: setup and GPU work must complete");
|
||||
} else {
|
||||
/* Pixel centre (x+0.5, y+0.5) in a 4x4 viewport; NDC y points up, so row y has
|
||||
* ndc_y = 1 - (y+0.5)/2. Group 0's triangle is x_ndc + y_ndc < 0 (payload 0x40),
|
||||
* group 1's is x_ndc + y_ndc > 0 (0x41); no pixel centre lies on the diagonal. */
|
||||
UINT wrong = 0, blank = 0;
|
||||
for (UINT y = 0; y < 4; ++y) {
|
||||
for (UINT x = 0; x < 4; ++x) {
|
||||
uint32_t v = 0;
|
||||
std::memcpy(&v, &data[tc.fp.Offset + y * tc.fp.Footprint.RowPitch + x * 4], 4);
|
||||
const double nx = (x + 0.5) / 2.0 - 1.0, ny = 1.0 - (y + 0.5) / 2.0;
|
||||
const uint32_t want = nx + ny < 0 ? 0x40u : 0x41u;
|
||||
blank += v == 0;
|
||||
wrong += v != want;
|
||||
}
|
||||
}
|
||||
observed("mesh pixels: %u of 16 wrong, %u left at the clear value", wrong, blank);
|
||||
result("mesh", wrong == 0 ? "runs-correctly" : "blocked",
|
||||
wrong == 0 ? "amplification payload and two mesh groups drawn as expected"
|
||||
: "the amplification+mesh pipeline did not draw the expected pixels");
|
||||
}
|
||||
drop(g, target);
|
||||
drop(g, rb);
|
||||
drop(g, rtv);
|
||||
release(pso);
|
||||
release(rs);
|
||||
release(list6);
|
||||
release(dev2);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
std::setvbuf(stdout, nullptr, _IONBF, 0);
|
||||
HMODULE d3d12 = LoadLibraryA("d3d12.dll");
|
||||
auto create = d3d12 ? reinterpret_cast<PFN_CreateDevice>(reinterpret_cast<void*>(GetProcAddress(d3d12, "D3D12CreateDevice"))) : nullptr;
|
||||
Gpu g;
|
||||
g.serialize = d3d12 ? reinterpret_cast<PFN_Serialize>(
|
||||
reinterpret_cast<void*>(GetProcAddress(d3d12, "D3D12SerializeRootSignature"))) : nullptr;
|
||||
if (!create || !g.serialize) {
|
||||
std::printf("SKIP: d3d12.dll or its exports are unavailable\n");
|
||||
return 77;
|
||||
}
|
||||
HRESULT hr = create(nullptr, D3D_FEATURE_LEVEL_12_0, __uuidof(ID3D12Device), reinterpret_cast<void**>(&g.dev));
|
||||
if (FAILED(hr) || !g.dev) {
|
||||
std::printf("SKIP: D3D12CreateDevice failed hr=0x%08lx\n", ul(hr));
|
||||
return 77;
|
||||
}
|
||||
D3D12_FEATURE_DATA_SHADER_MODEL sm = {D3D_SHADER_MODEL_6_6};
|
||||
if (FAILED(g.dev->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &sm, sizeof(sm))) ||
|
||||
sm.HighestShaderModel < D3D_SHADER_MODEL_6_6) {
|
||||
std::printf("SKIP: shader model 6.6 is not available\n");
|
||||
release(g.dev);
|
||||
return 77;
|
||||
}
|
||||
observed("device.shader_model 0x%x", static_cast<unsigned>(sm.HighestShaderModel));
|
||||
|
||||
D3D12_COMMAND_QUEUE_DESC qd = {};
|
||||
qd.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
|
||||
bool setup = SUCCEEDED(g.dev->CreateCommandQueue(&qd, __uuidof(ID3D12CommandQueue),
|
||||
reinterpret_cast<void**>(&g.queue))) &&
|
||||
SUCCEEDED(g.dev->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT,
|
||||
__uuidof(ID3D12CommandAllocator),
|
||||
reinterpret_cast<void**>(&g.alloc))) &&
|
||||
SUCCEEDED(g.dev->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, g.alloc, nullptr,
|
||||
__uuidof(ID3D12GraphicsCommandList),
|
||||
reinterpret_cast<void**>(&g.list))) &&
|
||||
SUCCEEDED(g.dev->CreateFence(0, D3D12_FENCE_FLAG_NONE, __uuidof(ID3D12Fence),
|
||||
reinterpret_cast<void**>(&g.fence)));
|
||||
g.event = CreateEventA(nullptr, FALSE, FALSE, nullptr);
|
||||
if (!require(setup && g.event, "queue, allocator, command list and fence creation")) return 1;
|
||||
|
||||
check_heap_index(g);
|
||||
check_wave64(g);
|
||||
std::printf("RESULT: atomic64 see-test_d3dmetal_gpu_limits (typed 64-bit atomics and their lock emulation are measured there)\n");
|
||||
check_mesh(g);
|
||||
if (g.lost) require(false, "GPU work must finish and the device must stay alive");
|
||||
|
||||
std::printf("SUMMARY: %d required checks, %d failed\n", g_required, g_failures);
|
||||
if (g.lost) return 1;
|
||||
release(g.fence);
|
||||
release(g.list);
|
||||
release(g.alloc);
|
||||
release(g.queue);
|
||||
release(g.dev);
|
||||
if (g.event) CloseHandle(g.event);
|
||||
return g_failures == 0 ? 0 : 1;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Regenerates the committed *.h shader headers for test_d3dmetal_translator_caps (#671).
|
||||
# Needs Microsoft's official DXC release v1.9.2609 (dxc_2026_09_29.zip, SHA-256
|
||||
# ad31b1fc8443175d204f77a611fdb3ef2ec42759bdc2f1167368de24a4a7e7f1); it has no
|
||||
# macOS build, so bin/x64/dxc.exe runs under a Wine/CrossOver loader.
|
||||
#
|
||||
# WINE=/path/to/wine DXC=/path/to/dxc/bin/x64/dxc.exe ./compile.sh
|
||||
set -eu
|
||||
: "${WINE:?set WINE to a Wine or CrossOver wine loader}"
|
||||
: "${DXC:?set DXC to dxc.exe from the DXC v1.9.2609 release}"
|
||||
cd "$(dirname "$0")"
|
||||
dxc() { "$WINE" "$DXC" -nologo "$@"; }
|
||||
dxc -T cs_6_6 -E main -Vn g_heap_index_cs -Fh heap_index.h heap_index.hlsl
|
||||
dxc -T cs_6_6 -E main -Vn g_wave64_emulation_cs -Fh wave64_emulation.h wave64_emulation.hlsl
|
||||
dxc -T as_6_6 -E as_main -Vn g_mesh_as -Fh mesh_as.h mesh.hlsl
|
||||
dxc -T ms_6_6 -E ms_main -Vn g_mesh_ms -Fh mesh_ms.h mesh.hlsl
|
||||
dxc -T ps_6_6 -E ps_main -Vn g_mesh_ps -Fh mesh_ps.h mesh.hlsl
|
||||
for pair in heap_index:heap_index wave64_emulation:wave64_emulation mesh_as:mesh mesh_ms:mesh mesh_ps:mesh; do
|
||||
h=${pair%%:*} src=${pair#*:}
|
||||
{
|
||||
printf '// SPDX-License-Identifier: GPL-3.0-or-later\n//\n'
|
||||
printf '// GENERATED by DXC 1.9.2609 from %s.hlsl by compile.sh; do not edit.\n\n' "$src"
|
||||
tr -d '\r' < "$h.h"
|
||||
} > "$h.h.tmp" && mv "$h.h.tmp" "$h.h"
|
||||
done
|
||||
@@ -0,0 +1,517 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
//
|
||||
// GENERATED by DXC 1.9.2609 from heap_index.hlsl by compile.sh; do not edit.
|
||||
|
||||
#if 0
|
||||
;
|
||||
; Note: shader requires additional functionality:
|
||||
; Resource descriptor heap indexing
|
||||
; Sampler descriptor heap indexing
|
||||
;
|
||||
;
|
||||
; Input signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; no parameters
|
||||
;
|
||||
; Output signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; no parameters
|
||||
; shader hash: b57f79fc70744ea5c2a5f08c555fc7c6
|
||||
;
|
||||
; Pipeline Runtime Information:
|
||||
;
|
||||
;PSVRuntimeInfo:
|
||||
; Compute Shader
|
||||
; NumThreads=(64,1,1)
|
||||
; MinimumExpectedWaveLaneCount: 0
|
||||
; MaximumExpectedWaveLaneCount: 4294967295
|
||||
; UsesViewID: false
|
||||
; SigInputElements: 0
|
||||
; SigOutputElements: 0
|
||||
; SigPatchConstOrPrimElements: 0
|
||||
; SigInputVectors: 0
|
||||
; SigOutputVectors[0]: 0
|
||||
; SigOutputVectors[1]: 0
|
||||
; SigOutputVectors[2]: 0
|
||||
; SigOutputVectors[3]: 0
|
||||
; EntryFunctionName: main
|
||||
;
|
||||
;
|
||||
; Buffer Definitions:
|
||||
;
|
||||
; cbuffer idx
|
||||
; {
|
||||
;
|
||||
; struct idx
|
||||
; {
|
||||
;
|
||||
; struct struct.Indices
|
||||
; {
|
||||
;
|
||||
; uint out_uav; ; Offset: 0
|
||||
; uint raw_srv; ; Offset: 4
|
||||
; uint typed_srv; ; Offset: 8
|
||||
; uint tex_srv; ; Offset: 12
|
||||
;
|
||||
; } idx; ; Offset: 0
|
||||
;
|
||||
;
|
||||
; } idx; ; Offset: 0 Size: 16
|
||||
;
|
||||
; }
|
||||
;
|
||||
;
|
||||
; Resource Bindings:
|
||||
;
|
||||
; Name Type Format Dim ID HLSL Bind Count
|
||||
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
|
||||
; idx cbuffer NA NA CB0 cb0 1
|
||||
;
|
||||
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
|
||||
target triple = "dxil-ms-dx"
|
||||
|
||||
%dx.types.Handle = type { i8* }
|
||||
%dx.types.ResBind = type { i32, i32, i32, i8 }
|
||||
%dx.types.ResourceProperties = type { i32, i32 }
|
||||
%dx.types.CBufRet.i32 = type { i32, i32, i32, i32 }
|
||||
%dx.types.ResRet.i32 = type { i32, i32, i32, i32, i32 }
|
||||
%dx.types.ResRet.f32 = type { float, float, float, float, i32 }
|
||||
%idx = type { %struct.Indices }
|
||||
%struct.Indices = type { i32, i32, i32, i32 }
|
||||
|
||||
define void @main() {
|
||||
%1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 2 }, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex)
|
||||
%2 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 13, i32 16 }) ; AnnotateHandle(res,props) resource: CBuffer
|
||||
%3 = call i32 @dx.op.threadId.i32(i32 93, i32 0) ; ThreadId(component)
|
||||
%4 = call %dx.types.CBufRet.i32 @dx.op.cbufferLoadLegacy.i32(i32 59, %dx.types.Handle %2, i32 0) ; CBufferLoadLegacy(handle,regIndex)
|
||||
%5 = extractvalue %dx.types.CBufRet.i32 %4, 0
|
||||
%6 = call %dx.types.Handle @dx.op.createHandleFromHeap(i32 218, i32 %5, i1 false, i1 false) ; CreateHandleFromHeap(index,samplerHeap,nonUniformIndex)
|
||||
%7 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %6, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
%8 = extractvalue %dx.types.CBufRet.i32 %4, 1
|
||||
%9 = call %dx.types.Handle @dx.op.createHandleFromHeap(i32 218, i32 %8, i1 false, i1 false) ; CreateHandleFromHeap(index,samplerHeap,nonUniformIndex)
|
||||
%10 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %9, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer
|
||||
%11 = extractvalue %dx.types.CBufRet.i32 %4, 2
|
||||
%12 = call %dx.types.Handle @dx.op.createHandleFromHeap(i32 218, i32 %11, i1 false, i1 false) ; CreateHandleFromHeap(index,samplerHeap,nonUniformIndex)
|
||||
%13 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %12, %dx.types.ResourceProperties { i32 10, i32 261 }) ; AnnotateHandle(res,props) resource: TypedBuffer<U32>
|
||||
%14 = shl i32 %3, 2
|
||||
%15 = call %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32 139, %dx.types.Handle %10, i32 %14, i32 undef, i8 1, i32 4) ; RawBufferLoad(srv,index,elementOffset,mask,alignment)
|
||||
%16 = extractvalue %dx.types.ResRet.i32 %15, 0
|
||||
%17 = mul i32 %16, 3
|
||||
%18 = call %dx.types.ResRet.i32 @dx.op.bufferLoad.i32(i32 68, %dx.types.Handle %13, i32 %3, i32 undef) ; BufferLoad(srv,index,wot)
|
||||
%19 = extractvalue %dx.types.ResRet.i32 %18, 0
|
||||
%20 = add i32 %17, %19
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %7, i32 %3, i32 0, i32 %20, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%21 = icmp eq i32 %3, 0
|
||||
br i1 %21, label %22, label %32
|
||||
|
||||
; <label>:22 ; preds = %0
|
||||
%23 = call %dx.types.CBufRet.i32 @dx.op.cbufferLoadLegacy.i32(i32 59, %dx.types.Handle %2, i32 0) ; CBufferLoadLegacy(handle,regIndex)
|
||||
%24 = extractvalue %dx.types.CBufRet.i32 %23, 3
|
||||
%25 = call %dx.types.Handle @dx.op.createHandleFromHeap(i32 218, i32 %24, i1 false, i1 false) ; CreateHandleFromHeap(index,samplerHeap,nonUniformIndex)
|
||||
%26 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %25, %dx.types.ResourceProperties { i32 2, i32 265 }) ; AnnotateHandle(res,props) resource: Texture2D<F32>
|
||||
%27 = call %dx.types.Handle @dx.op.createHandleFromHeap(i32 218, i32 0, i1 true, i1 false) ; CreateHandleFromHeap(index,samplerHeap,nonUniformIndex)
|
||||
%28 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %27, %dx.types.ResourceProperties { i32 14, i32 0 }) ; AnnotateHandle(res,props) resource: SamplerState
|
||||
%29 = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %26, %dx.types.Handle %28, float 7.500000e-01, float 2.500000e-01, float undef, float undef, i32 0, i32 0, i32 undef, float 0.000000e+00) ; SampleLevel(srv,sampler,coord0,coord1,coord2,coord3,offset0,offset1,offset2,LOD)
|
||||
%30 = extractvalue %dx.types.ResRet.f32 %29, 0
|
||||
%31 = bitcast float %30 to i32
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %7, i32 64, i32 0, i32 %31, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
br label %32
|
||||
|
||||
; <label>:32 ; preds = %22, %0
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare i32 @dx.op.threadId.i32(i32, i32) #0
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare %dx.types.Handle @dx.op.createHandleFromHeap(i32, i32, i1, i1) #0
|
||||
|
||||
; Function Attrs: nounwind readonly
|
||||
declare %dx.types.ResRet.i32 @dx.op.rawBufferLoad.i32(i32, %dx.types.Handle, i32, i32, i8, i32) #1
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.rawBufferStore.i32(i32, %dx.types.Handle, i32, i32, i32, i32, i32, i32, i8, i32) #2
|
||||
|
||||
; Function Attrs: nounwind readonly
|
||||
declare %dx.types.ResRet.i32 @dx.op.bufferLoad.i32(i32, %dx.types.Handle, i32, i32) #1
|
||||
|
||||
; Function Attrs: nounwind readonly
|
||||
declare %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32, %dx.types.Handle, %dx.types.Handle, float, float, float, float, i32, i32, i32, float) #1
|
||||
|
||||
; Function Attrs: nounwind readonly
|
||||
declare %dx.types.CBufRet.i32 @dx.op.cbufferLoadLegacy.i32(i32, %dx.types.Handle, i32) #1
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #0
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, i32, i1) #0
|
||||
|
||||
attributes #0 = { nounwind readnone }
|
||||
attributes #1 = { nounwind readonly }
|
||||
attributes #2 = { nounwind }
|
||||
|
||||
!llvm.ident = !{!0}
|
||||
!dx.version = !{!1}
|
||||
!dx.valver = !{!2}
|
||||
!dx.shaderModel = !{!3}
|
||||
!dx.resources = !{!4}
|
||||
!dx.entryPoints = !{!7}
|
||||
|
||||
!0 = !{!"dxcoob 1.9.2609.5 (01b62ad47)"}
|
||||
!1 = !{i32 1, i32 6}
|
||||
!2 = !{i32 1, i32 9}
|
||||
!3 = !{!"cs", i32 6, i32 6}
|
||||
!4 = !{null, null, !5, null}
|
||||
!5 = !{!6}
|
||||
!6 = !{i32 0, %idx* undef, !"", i32 0, i32 0, i32 1, i32 16, null}
|
||||
!7 = !{void ()* @main, !"main", null, !4, !8}
|
||||
!8 = !{i32 0, i64 3221225472, i32 4, !9}
|
||||
!9 = !{i32 64, i32 1, i32 1}
|
||||
|
||||
#endif
|
||||
|
||||
const unsigned char g_heap_index_cs[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x6a, 0x10, 0xf2, 0x40, 0x08, 0xc9, 0x05, 0xa5,
|
||||
0xec, 0x67, 0xcc, 0x3b, 0xf4, 0x14, 0x30, 0xfb, 0x01, 0x00, 0x00, 0x00,
|
||||
0xc4, 0x0f, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
|
||||
0xdc, 0x00, 0x00, 0x00, 0xe4, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x53, 0x47, 0x31,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x50, 0x53, 0x56, 0x30, 0x68, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x00, 0x07, 0x00, 0x00,
|
||||
0x66, 0x00, 0x05, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xe8, 0x06, 0x00, 0x00,
|
||||
0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00,
|
||||
0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
|
||||
0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
|
||||
0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, 0x14,
|
||||
0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20,
|
||||
0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
|
||||
0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
|
||||
0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d,
|
||||
0x86, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x01, 0xd5, 0x06, 0x62,
|
||||
0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0x90, 0x00, 0x49, 0x18, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00,
|
||||
0x32, 0x22, 0x88, 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84,
|
||||
0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8c, 0x8c,
|
||||
0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x94, 0xc1, 0x08, 0x40, 0x09, 0x00, 0x0a,
|
||||
0xe6, 0x08, 0xc0, 0xa0, 0x0c, 0xc3, 0x30, 0x10, 0x31, 0x47, 0x80, 0x90,
|
||||
0x71, 0xcf, 0x70, 0xf9, 0x13, 0xf6, 0x10, 0x92, 0x1f, 0x02, 0xcd, 0xb0,
|
||||
0x10, 0x28, 0x38, 0xe6, 0x08, 0x82, 0x52, 0x20, 0xc3, 0x90, 0x24, 0xa4,
|
||||
0xdc, 0x34, 0x5c, 0xfe, 0x84, 0x3d, 0x84, 0xe4, 0xaf, 0x84, 0xb4, 0x12,
|
||||
0x93, 0x8f, 0xdc, 0x36, 0x2a, 0x86, 0x61, 0x18, 0x86, 0x72, 0x30, 0x03,
|
||||
0x32, 0x0c, 0xc6, 0x40, 0x4d, 0x59, 0x80, 0x01, 0x19, 0x86, 0x61, 0x18,
|
||||
0x06, 0x63, 0xa0, 0xa7, 0x14, 0xcc, 0x80, 0x0c, 0x03, 0x45, 0x33, 0x00,
|
||||
0x37, 0x0d, 0x97, 0x3f, 0x61, 0x0f, 0x21, 0xf9, 0x2b, 0x21, 0xad, 0xc4,
|
||||
0xe4, 0x17, 0xb7, 0x8d, 0x8a, 0x69, 0x9a, 0xa6, 0xa1, 0x30, 0xd4, 0x80,
|
||||
0x20, 0xd3, 0x34, 0x4d, 0xc3, 0x30, 0x4c, 0x54, 0x1d, 0x35, 0x5c, 0xfe,
|
||||
0x84, 0x3d, 0x84, 0xe4, 0x73, 0x1b, 0x55, 0xac, 0xc4, 0xe4, 0x23, 0xb7,
|
||||
0x8d, 0x88, 0x61, 0x18, 0x86, 0x42, 0x5c, 0x03, 0x32, 0x10, 0x76, 0xdb,
|
||||
0x70, 0xf9, 0x13, 0xf6, 0x10, 0x92, 0xbf, 0x12, 0x92, 0x43, 0x45, 0x02,
|
||||
0x91, 0x46, 0xce, 0x43, 0x44, 0x13, 0x42, 0x48, 0x48, 0x18, 0x86, 0x42,
|
||||
0x20, 0x03, 0xa2, 0xd1, 0x76, 0xd0, 0x70, 0xf9, 0x13, 0xf6, 0x10, 0x92,
|
||||
0xbf, 0x12, 0xd2, 0x86, 0x34, 0x03, 0x22, 0x86, 0x61, 0x30, 0x4a, 0x81,
|
||||
0x0c, 0xdd, 0x90, 0x90, 0x37, 0x10, 0x70, 0x8e, 0x34, 0x45, 0x94, 0x30,
|
||||
0xf9, 0x62, 0x33, 0x20, 0x02, 0x21, 0x21, 0x62, 0x18, 0x86, 0xe1, 0x06,
|
||||
0x64, 0xb8, 0x50, 0x10, 0x92, 0x38, 0x47, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79,
|
||||
0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
|
||||
0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07,
|
||||
0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e,
|
||||
0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07,
|
||||
0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
|
||||
0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x04, 0x10, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x14, 0x20,
|
||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x34,
|
||||
0x40, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4,
|
||||
0x79, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
|
||||
0xc8, 0x13, 0x01, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xc0, 0x90, 0xa7, 0x02, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x80, 0x21, 0x0f, 0x06, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x43, 0x9e, 0x0d, 0x08, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x81, 0x00, 0x0e, 0x00, 0x00, 0x00,
|
||||
0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47,
|
||||
0xc6, 0x04, 0x43, 0x1a, 0x4a, 0xa0, 0x18, 0x46, 0x00, 0x0a, 0xa4, 0x0c,
|
||||
0xca, 0xa1, 0x14, 0x0a, 0xa1, 0x20, 0x0a, 0xa3, 0x00, 0x03, 0xca, 0xa8,
|
||||
0x08, 0x88, 0x2c, 0x40, 0x40, 0x40, 0x40, 0x0c, 0x12, 0x67, 0x00, 0x68,
|
||||
0x9c, 0x01, 0xa0, 0x70, 0x06, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x75, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4,
|
||||
0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45,
|
||||
0xc6, 0x06, 0x26, 0xc7, 0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46,
|
||||
0x26, 0x8c, 0x8c, 0xe6, 0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x06, 0x65,
|
||||
0x82, 0x30, 0x2c, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x0c, 0xcc, 0x06, 0xc1,
|
||||
0x30, 0x28, 0x8c, 0xcd, 0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x8c, 0x41,
|
||||
0xc6, 0x21, 0x8d, 0x0c, 0x6f, 0x82, 0x30, 0x34, 0x1b, 0x10, 0x43, 0x59,
|
||||
0x0c, 0x63, 0x60, 0x80, 0x0d, 0x41, 0xb3, 0x81, 0x00, 0x00, 0x07, 0x98,
|
||||
0x20, 0x84, 0x81, 0xc6, 0xe3, 0xad, 0x8e, 0xee, 0xab, 0x2e, 0xcc, 0x6e,
|
||||
0x82, 0x30, 0x38, 0x13, 0x84, 0xe1, 0x99, 0x20, 0x0c, 0xd0, 0x06, 0x83,
|
||||
0x88, 0x24, 0x63, 0xa2, 0x78, 0xc8, 0x85, 0xdd, 0x7d, 0xcd, 0xc9, 0xd9,
|
||||
0x4d, 0x10, 0x86, 0x68, 0x83, 0x41, 0x58, 0xd2, 0x35, 0x51, 0x4c, 0xe8,
|
||||
0xf2, 0xe0, 0xca, 0xc8, 0xbe, 0xe6, 0xe4, 0xec, 0x26, 0x08, 0x83, 0xb4,
|
||||
0xc1, 0x20, 0x32, 0x49, 0x9b, 0x28, 0x1e, 0x74, 0x65, 0x78, 0x5f, 0x73,
|
||||
0x72, 0x76, 0x13, 0x84, 0x61, 0xda, 0x60, 0x10, 0x9c, 0xd4, 0x4d, 0xd4,
|
||||
0x86, 0x82, 0xa9, 0xb0, 0xcd, 0x9b, 0x20, 0x88, 0x01, 0xb6, 0x81, 0x20,
|
||||
0x16, 0xc9, 0xd8, 0x20, 0x30, 0x61, 0xb0, 0xa1, 0x30, 0xa0, 0x0f, 0x0c,
|
||||
0xc4, 0x60, 0x82, 0x20, 0x00, 0x1b, 0x80, 0x0d, 0x83, 0x51, 0x06, 0x65,
|
||||
0xb0, 0x21, 0x30, 0x83, 0x0d, 0xc3, 0x40, 0x06, 0x67, 0x40, 0xa2, 0x2d,
|
||||
0x2c, 0xcd, 0x6d, 0x82, 0x40, 0x06, 0xd7, 0x04, 0x61, 0xa0, 0x36, 0x0c,
|
||||
0x6b, 0x30, 0x0c, 0x1b, 0x08, 0x43, 0x0d, 0x2e, 0x36, 0xd8, 0x50, 0x90,
|
||||
0x41, 0x1a, 0x00, 0x4f, 0x1b, 0x10, 0x11, 0x93, 0x0b, 0x73, 0x1b, 0x43,
|
||||
0x2b, 0x9b, 0x63, 0x91, 0xe6, 0x36, 0x47, 0x37, 0x37, 0x41, 0x18, 0x2a,
|
||||
0x12, 0x69, 0x6e, 0x74, 0x73, 0x44, 0xe8, 0xca, 0xf0, 0xbe, 0xd8, 0xde,
|
||||
0xc2, 0xc8, 0x26, 0x08, 0x83, 0x45, 0x84, 0xae, 0x0c, 0xef, 0xcb, 0xed,
|
||||
0x4d, 0xae, 0x8d, 0x09, 0x5d, 0x19, 0xde, 0xd7, 0x1c, 0xdd, 0x9b, 0x5c,
|
||||
0x19, 0x8b, 0xba, 0x34, 0x37, 0xba, 0xb9, 0x0d, 0xce, 0x1b, 0x0c, 0x70,
|
||||
0x10, 0x07, 0x72, 0x20, 0xcd, 0x01, 0x1d, 0xd4, 0xc1, 0x60, 0x07, 0x74,
|
||||
0x70, 0x07, 0x43, 0x15, 0x36, 0x36, 0xbb, 0x36, 0x97, 0x34, 0xb2, 0x32,
|
||||
0x37, 0xba, 0x29, 0x41, 0x50, 0x85, 0x0c, 0xcf, 0xc5, 0xae, 0x4c, 0x6e,
|
||||
0x2e, 0xed, 0xcd, 0x6d, 0x4a, 0x40, 0x34, 0x21, 0xc3, 0x73, 0xb1, 0x0b,
|
||||
0x63, 0xb3, 0x2b, 0x93, 0x9b, 0x12, 0x18, 0x75, 0xc8, 0xf0, 0x5c, 0xe6,
|
||||
0xd0, 0xc2, 0xc8, 0xca, 0xe4, 0x9a, 0xde, 0xc8, 0xca, 0xd8, 0xa6, 0x04,
|
||||
0x48, 0x19, 0x32, 0x3c, 0x17, 0xb9, 0xb2, 0xb9, 0xb7, 0x3a, 0xb9, 0xb1,
|
||||
0xb2, 0xb9, 0x29, 0x81, 0x53, 0x89, 0x0c, 0xcf, 0x85, 0x2e, 0x0f, 0xae,
|
||||
0x2c, 0xc8, 0xcd, 0xed, 0x8d, 0x2e, 0x8c, 0x2e, 0xed, 0xcd, 0x6d, 0x6e,
|
||||
0x8a, 0x20, 0x06, 0x67, 0x50, 0x87, 0x0c, 0xcf, 0xa5, 0xcc, 0x8d, 0x4e,
|
||||
0x2e, 0x0f, 0xea, 0x2d, 0xcd, 0x8d, 0x6e, 0x6e, 0x4a, 0xd0, 0x06, 0x5d,
|
||||
0xc8, 0xf0, 0x5c, 0xc6, 0xde, 0xea, 0xdc, 0xe8, 0xca, 0xe4, 0xe6, 0xa6,
|
||||
0x04, 0x77, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
|
||||
0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
|
||||
0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
|
||||
0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
|
||||
0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
|
||||
0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
|
||||
0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
|
||||
0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
|
||||
0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
|
||||
0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
|
||||
0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
|
||||
0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
|
||||
0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
|
||||
0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
|
||||
0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
|
||||
0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
|
||||
0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
|
||||
0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
|
||||
0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
|
||||
0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
|
||||
0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
|
||||
0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4,
|
||||
0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19,
|
||||
0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06,
|
||||
0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f,
|
||||
0xf4, 0x30, 0x83, 0x81, 0xc8, 0x01, 0x1f, 0xdc, 0x40, 0x1c, 0xe4, 0xa1,
|
||||
0x1c, 0xc2, 0x61, 0x1d, 0xdc, 0x40, 0x1c, 0xe4, 0x01, 0x00, 0x00, 0x00,
|
||||
0x71, 0x20, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x86, 0x40, 0x0d, 0x97,
|
||||
0xef, 0x3c, 0x3e, 0xd0, 0x34, 0xce, 0x04, 0x4c, 0x44, 0x08, 0x34, 0xc3,
|
||||
0x42, 0x58, 0x01, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0x01, 0x55, 0x14, 0x44,
|
||||
0x54, 0x3a, 0xc0, 0xe0, 0x23, 0xb7, 0x6d, 0x07, 0xdb, 0x70, 0xf9, 0xce,
|
||||
0xe3, 0x0b, 0x01, 0x55, 0x14, 0x44, 0x54, 0x3a, 0xc0, 0x50, 0x12, 0x06,
|
||||
0x20, 0x60, 0x3e, 0x72, 0xdb, 0x96, 0xd0, 0x0d, 0x97, 0xef, 0x3c, 0xbe,
|
||||
0x10, 0x11, 0xc0, 0x44, 0x84, 0x40, 0x33, 0x2c, 0xc4, 0x17, 0x39, 0xcc,
|
||||
0x86, 0x34, 0x03, 0xd2, 0x18, 0x26, 0xa0, 0x0d, 0x97, 0xef, 0x3c, 0xbe,
|
||||
0x10, 0x11, 0xc0, 0x44, 0x84, 0x40, 0x33, 0x2c, 0xc4, 0x17, 0x39, 0x4c,
|
||||
0x48, 0x00, 0x8f, 0x0d, 0x5c, 0xc3, 0xe5, 0x3b, 0x8f, 0x1f, 0x01, 0xd6,
|
||||
0x46, 0x15, 0x05, 0x11, 0x95, 0x0e, 0x30, 0xf8, 0xc8, 0x6d, 0x1b, 0x01,
|
||||
0x36, 0x5c, 0xbe, 0xf3, 0xf8, 0x11, 0x60, 0x6d, 0x54, 0x51, 0x10, 0x11,
|
||||
0x3b, 0x39, 0x11, 0xe1, 0x23, 0xb7, 0x6d, 0x06, 0xd5, 0x70, 0xf9, 0xce,
|
||||
0xe3, 0x4b, 0x00, 0xf3, 0x2c, 0x44, 0x49, 0x54, 0xc4, 0xe2, 0x17, 0xb7,
|
||||
0x6d, 0x01, 0xd2, 0x70, 0xf9, 0xce, 0xe3, 0x4f, 0x47, 0x44, 0x00, 0x83,
|
||||
0x38, 0xf8, 0xc8, 0x6d, 0x1b, 0x00, 0xc1, 0x00, 0x48, 0x03, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xb5, 0x7f, 0x79, 0xfc, 0x70, 0x74, 0x4e, 0xa5,
|
||||
0xc2, 0xa5, 0xf0, 0x8c, 0x55, 0x5f, 0xc7, 0xc6, 0x44, 0x58, 0x49, 0x4c,
|
||||
0xbc, 0x07, 0x00, 0x00, 0x66, 0x00, 0x05, 0x00, 0xef, 0x01, 0x00, 0x00,
|
||||
0x44, 0x58, 0x49, 0x4c, 0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0xa4, 0x07, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
|
||||
0xe6, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
|
||||
0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
|
||||
0x1e, 0x04, 0x8b, 0x62, 0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
|
||||
0xc4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88,
|
||||
0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
|
||||
0xe4, 0x48, 0x0e, 0x90, 0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
|
||||
0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
|
||||
0x40, 0x02, 0xa8, 0x0d, 0x86, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20,
|
||||
0x01, 0xd5, 0x06, 0x62, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0x90, 0x00,
|
||||
0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42,
|
||||
0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00,
|
||||
0x42, 0x00, 0x00, 0x00, 0x32, 0x22, 0x88, 0x09, 0x20, 0x64, 0x85, 0x04,
|
||||
0x13, 0x23, 0xa4, 0x84, 0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, 0x14,
|
||||
0x12, 0x4c, 0x8c, 0x8c, 0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x98, 0xc1, 0x08,
|
||||
0x40, 0x09, 0x00, 0x0a, 0xe6, 0x08, 0xc0, 0xa0, 0x0c, 0xc3, 0x30, 0x10,
|
||||
0x31, 0x47, 0x80, 0x90, 0x71, 0xcf, 0x70, 0xf9, 0x13, 0xf6, 0x10, 0x92,
|
||||
0x1f, 0x02, 0xcd, 0xb0, 0x10, 0x28, 0x38, 0xe6, 0x08, 0x82, 0x52, 0x20,
|
||||
0xc3, 0x90, 0x24, 0xa4, 0xdc, 0x34, 0x5c, 0xfe, 0x84, 0x3d, 0x84, 0xe4,
|
||||
0xaf, 0x84, 0xb4, 0x12, 0x93, 0x8f, 0xdc, 0x36, 0x2a, 0x86, 0x61, 0x18,
|
||||
0x86, 0x72, 0x30, 0x03, 0x32, 0x0c, 0xc6, 0x40, 0x4d, 0x59, 0x80, 0x01,
|
||||
0x19, 0x86, 0x61, 0x18, 0x06, 0x63, 0xa0, 0xa7, 0x14, 0xcc, 0x80, 0x0c,
|
||||
0x03, 0x45, 0x33, 0x00, 0x37, 0x0d, 0x97, 0x3f, 0x61, 0x0f, 0x21, 0xf9,
|
||||
0x2b, 0x21, 0xad, 0xc4, 0xe4, 0x17, 0xb7, 0x8d, 0x8a, 0x69, 0x9a, 0xa6,
|
||||
0xa1, 0x30, 0xd4, 0x80, 0x20, 0xd3, 0x34, 0x4d, 0xc3, 0x30, 0x4c, 0x54,
|
||||
0x1d, 0x35, 0x5c, 0xfe, 0x84, 0x3d, 0x84, 0xe4, 0x73, 0x1b, 0x55, 0xac,
|
||||
0xc4, 0xe4, 0x23, 0xb7, 0x8d, 0x88, 0x61, 0x18, 0x86, 0x42, 0x5c, 0x03,
|
||||
0x32, 0x10, 0x76, 0xdb, 0x70, 0xf9, 0x13, 0xf6, 0x10, 0x92, 0xbf, 0x12,
|
||||
0x92, 0x43, 0x45, 0x02, 0x91, 0x46, 0xce, 0x43, 0x44, 0x13, 0x42, 0x48,
|
||||
0x48, 0x18, 0x86, 0x42, 0x20, 0x03, 0xa2, 0xd1, 0x76, 0xd0, 0x70, 0xf9,
|
||||
0x13, 0xf6, 0x10, 0x92, 0xbf, 0x12, 0xd2, 0x86, 0x34, 0x03, 0x22, 0x86,
|
||||
0x61, 0x30, 0x4a, 0x81, 0x0c, 0xdd, 0x90, 0x90, 0x37, 0x10, 0x70, 0x8e,
|
||||
0x34, 0x45, 0x94, 0x30, 0xf9, 0x62, 0x33, 0x20, 0x02, 0x21, 0x21, 0x62,
|
||||
0x18, 0x86, 0xe1, 0x06, 0x64, 0xb8, 0x50, 0x10, 0x92, 0x38, 0x47, 0x00,
|
||||
0x0a, 0x53, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
|
||||
0x3c, 0x04, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x79, 0x14, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0xf2, 0x34, 0x40, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0xe4, 0x79, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x60, 0xc8, 0x13, 0x01, 0x01, 0x20, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0xa7, 0x02, 0x02, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x0f, 0x06, 0x04, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x9e, 0x0d, 0x08, 0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x1e, 0x10,
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x81, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
|
||||
0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x1a, 0x4a, 0xa0, 0x18, 0x4a,
|
||||
0x62, 0x04, 0xa0, 0x40, 0x0a, 0xa1, 0x00, 0x03, 0x88, 0x2c, 0x40, 0x40,
|
||||
0x40, 0x40, 0x0c, 0x1a, 0x67, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x37, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4,
|
||||
0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45,
|
||||
0xc6, 0x06, 0x26, 0xc7, 0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46,
|
||||
0x26, 0x8c, 0x8c, 0xe6, 0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x06, 0x65,
|
||||
0x82, 0x30, 0x2c, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x0c, 0xcc, 0x06, 0x61,
|
||||
0x30, 0x28, 0x8c, 0xcd, 0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x0c, 0xcd,
|
||||
0x04, 0x61, 0x0c, 0x24, 0x02, 0x13, 0x84, 0xc1, 0xd9, 0x80, 0x28, 0x0b,
|
||||
0xa3, 0x28, 0x43, 0x03, 0x6c, 0x08, 0x9c, 0x0d, 0x04, 0x00, 0x3c, 0xc0,
|
||||
0x04, 0x41, 0x00, 0x48, 0xb4, 0x85, 0xa5, 0xb9, 0x4d, 0x10, 0xc8, 0x20,
|
||||
0x9a, 0x20, 0x0c, 0xcf, 0x04, 0x61, 0x80, 0x36, 0x0c, 0xd5, 0x30, 0x6c,
|
||||
0x20, 0x94, 0x89, 0xb2, 0x36, 0x14, 0x91, 0x04, 0x40, 0x57, 0x15, 0x36,
|
||||
0x36, 0xbb, 0x36, 0x97, 0x34, 0xb2, 0x32, 0x37, 0xba, 0x29, 0x41, 0x50,
|
||||
0x85, 0x0c, 0xcf, 0xc5, 0xae, 0x4c, 0x6e, 0x2e, 0xed, 0xcd, 0x6d, 0x4a,
|
||||
0x40, 0x34, 0x21, 0xc3, 0x73, 0xb1, 0x0b, 0x63, 0xb3, 0x2b, 0x93, 0x9b,
|
||||
0x12, 0x18, 0x75, 0xc8, 0xf0, 0x5c, 0xe6, 0xd0, 0xc2, 0xc8, 0xca, 0xe4,
|
||||
0x9a, 0xde, 0xc8, 0xca, 0xd8, 0xa6, 0x04, 0x48, 0x19, 0x32, 0x3c, 0x17,
|
||||
0xb9, 0xb2, 0xb9, 0xb7, 0x3a, 0xb9, 0xb1, 0xb2, 0xb9, 0x29, 0xc1, 0x53,
|
||||
0x87, 0x0c, 0xcf, 0xa5, 0xcc, 0x8d, 0x4e, 0x2e, 0x0f, 0xea, 0x2d, 0xcd,
|
||||
0x8d, 0x6e, 0x6e, 0x4a, 0x70, 0x01, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x51, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87,
|
||||
0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20,
|
||||
0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90,
|
||||
0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x30, 0x83, 0x81, 0xc8, 0x01, 0x1f, 0xdc,
|
||||
0x40, 0x1c, 0xe4, 0xa1, 0x1c, 0xc2, 0x61, 0x1d, 0xdc, 0x40, 0x1c, 0xe4,
|
||||
0x01, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00,
|
||||
0x86, 0x40, 0x0d, 0x97, 0xef, 0x3c, 0x3e, 0xd0, 0x34, 0xce, 0x04, 0x4c,
|
||||
0x44, 0x08, 0x34, 0xc3, 0x42, 0x58, 0x01, 0x35, 0x5c, 0xbe, 0xf3, 0xf8,
|
||||
0x01, 0x55, 0x14, 0x44, 0x54, 0x3a, 0xc0, 0xe0, 0x23, 0xb7, 0x6d, 0x07,
|
||||
0xdb, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x01, 0x55, 0x14, 0x44, 0x54, 0x3a,
|
||||
0xc0, 0x50, 0x12, 0x06, 0x20, 0x60, 0x3e, 0x72, 0xdb, 0x96, 0xd0, 0x0d,
|
||||
0x97, 0xef, 0x3c, 0xbe, 0x10, 0x11, 0xc0, 0x44, 0x84, 0x40, 0x33, 0x2c,
|
||||
0xc4, 0x17, 0x39, 0xcc, 0x86, 0x34, 0x03, 0xd2, 0x18, 0x26, 0xa0, 0x0d,
|
||||
0x97, 0xef, 0x3c, 0xbe, 0x10, 0x11, 0xc0, 0x44, 0x84, 0x40, 0x33, 0x2c,
|
||||
0xc4, 0x17, 0x39, 0x4c, 0x48, 0x00, 0x8f, 0x0d, 0x5c, 0xc3, 0xe5, 0x3b,
|
||||
0x8f, 0x1f, 0x01, 0xd6, 0x46, 0x15, 0x05, 0x11, 0x95, 0x0e, 0x30, 0xf8,
|
||||
0xc8, 0x6d, 0x1b, 0x01, 0x36, 0x5c, 0xbe, 0xf3, 0xf8, 0x11, 0x60, 0x6d,
|
||||
0x54, 0x51, 0x10, 0x11, 0x3b, 0x39, 0x11, 0xe1, 0x23, 0xb7, 0x6d, 0x06,
|
||||
0xd5, 0x70, 0xf9, 0xce, 0xe3, 0x4b, 0x00, 0xf3, 0x2c, 0x44, 0x49, 0x54,
|
||||
0xc4, 0xe2, 0x17, 0xb7, 0x6d, 0x01, 0xd2, 0x70, 0xf9, 0xce, 0xe3, 0x4f,
|
||||
0x47, 0x44, 0x00, 0x83, 0x38, 0xf8, 0xc8, 0x6d, 0x1b, 0x00, 0xc1, 0x00,
|
||||
0x48, 0x03, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00,
|
||||
0x13, 0x04, 0x43, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x34, 0xcc, 0x00, 0x14, 0xec, 0x40, 0xd1, 0x0e, 0x94, 0x5d, 0x11, 0x14,
|
||||
0xa6, 0x40, 0xc9, 0x0e, 0x94, 0x46, 0xe9, 0x06, 0x14, 0x26, 0x50, 0x59,
|
||||
0x14, 0x45, 0x29, 0x12, 0x94, 0xa5, 0x40, 0x19, 0x14, 0x62, 0x40, 0x49,
|
||||
0x12, 0x14, 0x47, 0xf1, 0x91, 0x51, 0x02, 0x45, 0x40, 0xc9, 0x08, 0x40,
|
||||
0x0d, 0xd0, 0x34, 0x03, 0x30, 0x46, 0x00, 0x82, 0x20, 0x48, 0x7f, 0x63,
|
||||
0x04, 0x20, 0x08, 0x82, 0xe8, 0x37, 0x02, 0x40, 0xda, 0x1c, 0x82, 0xe6,
|
||||
0xcc, 0x21, 0x70, 0xcf, 0x1c, 0x42, 0xd7, 0xcc, 0x21, 0x78, 0xdf, 0x1c,
|
||||
0xc2, 0x35, 0x06, 0x73, 0x08, 0x64, 0xd0, 0x50, 0x37, 0x07, 0xd1, 0x34,
|
||||
0xcd, 0x19, 0x00, 0x00, 0x23, 0x06, 0x08, 0x00, 0x82, 0x60, 0xe0, 0xb1,
|
||||
0x01, 0x17, 0xa0, 0x41, 0x33, 0x62, 0x70, 0x00, 0x20, 0x08, 0x06, 0x9b,
|
||||
0x1b, 0x88, 0x41, 0x80, 0x8c, 0x18, 0x18, 0x00, 0x08, 0x82, 0x01, 0x61,
|
||||
0x07, 0x9c, 0x1a, 0x8c, 0x18, 0x1c, 0x00, 0x08, 0x82, 0x01, 0x16, 0x07,
|
||||
0x62, 0x20, 0xac, 0xc1, 0x68, 0x42, 0x00, 0x8c, 0x18, 0x20, 0x00, 0x08,
|
||||
0x82, 0x81, 0x82, 0x07, 0x65, 0x10, 0x48, 0xd2, 0x88, 0xc1, 0x01, 0x80,
|
||||
0x20, 0x18, 0x6c, 0x73, 0x70, 0x06, 0x01, 0x33, 0x9a, 0x40, 0x04, 0x23,
|
||||
0x06, 0x08, 0x00, 0x82, 0x60, 0xa0, 0xec, 0x01, 0x1a, 0x04, 0x55, 0x35,
|
||||
0x62, 0x70, 0x00, 0x20, 0x08, 0x06, 0x9b, 0x1d, 0xa8, 0x41, 0xe0, 0x8c,
|
||||
0x26, 0x1c, 0xc2, 0x88, 0x01, 0x02, 0x80, 0x20, 0x18, 0x28, 0x7e, 0xb0,
|
||||
0x06, 0x01, 0x86, 0x8d, 0x18, 0x1c, 0x00, 0x08, 0x82, 0xc1, 0x96, 0x07,
|
||||
0x6d, 0x10, 0x40, 0xb5, 0xac, 0xc1, 0x8d, 0x18, 0x28, 0x00, 0x08, 0x82,
|
||||
0x41, 0x03, 0x0a, 0x63, 0x50, 0x04, 0x70, 0xd0, 0xd1, 0xc1, 0x68, 0x42,
|
||||
0x00, 0x54, 0x40, 0x06, 0x32, 0x62, 0x80, 0x00, 0x20, 0x08, 0x06, 0x51,
|
||||
0x28, 0x90, 0x41, 0xf1, 0xcc, 0xc1, 0x68, 0x42, 0x00, 0xd4, 0x10, 0xc0,
|
||||
0x88, 0x81, 0x03, 0x80, 0x20, 0x18, 0x3c, 0xa5, 0x10, 0x07, 0x8e, 0xc4,
|
||||
0x07, 0x81, 0x1d, 0xd8, 0x81, 0x1d, 0x8c, 0x81, 0x1e, 0x0c, 0x37, 0x48,
|
||||
0x7c, 0x00, 0x06, 0xb3, 0x0c, 0x81, 0x10, 0x8c, 0x18, 0x1c, 0x00, 0x08,
|
||||
0x82, 0x01, 0x36, 0x0a, 0x74, 0x40, 0xf5, 0xc1, 0x68, 0x42, 0x30, 0x8c,
|
||||
0x18, 0x20, 0x00, 0x08, 0x82, 0x81, 0xa2, 0x0a, 0x77, 0x10, 0x90, 0x01,
|
||||
0x19, 0x8c, 0x18, 0x1c, 0x00, 0x08, 0x82, 0xc1, 0x56, 0x0a, 0x79, 0x10,
|
||||
0x6c, 0x23, 0x06, 0x08, 0x00, 0x82, 0x60, 0xa0, 0xb0, 0x42, 0x1e, 0x84,
|
||||
0x42, 0x19, 0x98, 0xc1, 0x88, 0xc1, 0x01, 0x80, 0x20, 0x18, 0x6c, 0xa7,
|
||||
0xb0, 0x07, 0x01, 0x37, 0x62, 0xf0, 0x00, 0x20, 0x08, 0x06, 0x95, 0x2a,
|
||||
0xac, 0xc1, 0x10, 0x94, 0x01, 0x19, 0x98, 0x81, 0x19, 0x8c, 0xc2, 0x28,
|
||||
0xf4, 0xc1, 0x18, 0x8c, 0x26, 0x04, 0xc0, 0x05, 0xc3, 0x8e, 0x18, 0x38,
|
||||
0x00, 0x08, 0x82, 0xc1, 0xf3, 0x0a, 0x7b, 0x80, 0x8d, 0x82, 0x29, 0x04,
|
||||
0xa0, 0x00, 0x0a, 0xa0, 0xd0, 0x06, 0xa4, 0x30, 0x4b, 0x20, 0x20, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// #671 check 1: SM 6.6 dynamic resources. Every resource and the sampler come from the
|
||||
// descriptor heaps by index (ResourceDescriptorHeap / SamplerDescriptorHeap), the binding
|
||||
// model a translator of console code that reads descriptors from memory relies on.
|
||||
struct Indices { uint out_uav; uint raw_srv; uint typed_srv; uint tex_srv; };
|
||||
ConstantBuffer<Indices> idx : register(b0);
|
||||
|
||||
[numthreads(64, 1, 1)]
|
||||
void main(uint3 id : SV_DispatchThreadID)
|
||||
{
|
||||
RWStructuredBuffer<uint> outb = ResourceDescriptorHeap[idx.out_uav];
|
||||
ByteAddressBuffer raw = ResourceDescriptorHeap[idx.raw_srv];
|
||||
Buffer<uint> typed = ResourceDescriptorHeap[idx.typed_srv];
|
||||
outb[id.x] = raw.Load(4 * id.x) * 3u + typed[id.x];
|
||||
if (id.x == 0) {
|
||||
Texture2D<float> tex = ResourceDescriptorHeap[idx.tex_srv];
|
||||
SamplerState point_clamp = SamplerDescriptorHeap[0];
|
||||
// Texel (1,0) of a 2x2 texture, sampled at its centre with point filtering.
|
||||
outb[64] = asuint(tex.SampleLevel(point_clamp, float2(0.75, 0.25), 0));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// #671 check 4: amplification -> mesh -> pixel. The amplification shader launches two mesh
|
||||
// groups and passes a colour in its payload; each mesh group emits one triangle covering half
|
||||
// of a 4x4 render target. The pixel shader writes the payload colour plus the group index.
|
||||
struct Payload { uint colour; };
|
||||
groupshared Payload g_payload;
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void as_main()
|
||||
{
|
||||
g_payload.colour = 0x40u;
|
||||
DispatchMesh(2, 1, 1, g_payload);
|
||||
}
|
||||
|
||||
struct VOut { float4 pos : SV_Position; nointerpolation uint colour : COLOR0; };
|
||||
|
||||
[outputtopology("triangle")]
|
||||
[numthreads(3, 1, 1)]
|
||||
void ms_main(uint gtid : SV_GroupThreadID, uint gid : SV_GroupID, in payload Payload pl,
|
||||
out vertices VOut verts[3], out indices uint3 tris[1])
|
||||
{
|
||||
SetMeshOutputCounts(3, 1);
|
||||
// Group 0: the lower-left half of the viewport (x + y < 0 in NDC), group 1 the upper-right
|
||||
// half (x + y > 0). They meet on the diagonal, which no pixel centre of a 4x4 target lies on.
|
||||
const float2 a = gid == 0 ? float2(-1, -1) : float2(1, 1);
|
||||
const float2 c0 = gid == 0 ? float2(-1, 1) : float2(1, -1);
|
||||
const float2 c1 = gid == 0 ? float2(1, -1) : float2(-1, 1);
|
||||
const float2 pos = gtid == 0 ? a : (gtid == 1 ? c0 : c1);
|
||||
verts[gtid].pos = float4(pos, 0, 1);
|
||||
verts[gtid].colour = pl.colour + gid;
|
||||
if (gtid == 0) tris[0] = uint3(0, 1, 2);
|
||||
}
|
||||
|
||||
uint ps_main(VOut v) : SV_Target { return v.colour; }
|
||||
@@ -0,0 +1,296 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
//
|
||||
// GENERATED by DXC 1.9.2609 from mesh.hlsl by compile.sh; do not edit.
|
||||
|
||||
#if 0
|
||||
;
|
||||
; Input signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; no parameters
|
||||
;
|
||||
; Output signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; no parameters
|
||||
; shader hash: 09a9460a69151441aae685ce3642c255
|
||||
;
|
||||
; Pipeline Runtime Information:
|
||||
;
|
||||
;PSVRuntimeInfo:
|
||||
; Amplification Shader
|
||||
; NumThreads=(1,1,1)
|
||||
; MinimumExpectedWaveLaneCount: 0
|
||||
; MaximumExpectedWaveLaneCount: 4294967295
|
||||
; UsesViewID: false
|
||||
; SigInputElements: 0
|
||||
; SigOutputElements: 0
|
||||
; SigPatchConstOrPrimElements: 0
|
||||
; SigInputVectors: 0
|
||||
; SigOutputVectors[0]: 0
|
||||
; SigOutputVectors[1]: 0
|
||||
; SigOutputVectors[2]: 0
|
||||
; SigOutputVectors[3]: 0
|
||||
; EntryFunctionName: as_main
|
||||
;
|
||||
;
|
||||
; Buffer Definitions:
|
||||
;
|
||||
;
|
||||
; Resource Bindings:
|
||||
;
|
||||
; Name Type Format Dim ID HLSL Bind Count
|
||||
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
|
||||
;
|
||||
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
|
||||
target triple = "dxil-ms-dx"
|
||||
|
||||
%struct.Payload = type { i32 }
|
||||
|
||||
@"\01?g_payload@@3UPayload@@A" = external addrspace(3) global %struct.Payload, align 4
|
||||
|
||||
define void @as_main() {
|
||||
store i32 64, i32 addrspace(3)* getelementptr inbounds (%struct.Payload, %struct.Payload addrspace(3)* @"\01?g_payload@@3UPayload@@A", i32 0, i32 0), align 4, !tbaa !8
|
||||
call void @dx.op.dispatchMesh.struct.Payload(i32 173, i32 2, i32 1, i32 1, %struct.Payload addrspace(3)* nonnull @"\01?g_payload@@3UPayload@@A") ; DispatchMesh(threadGroupCountX,threadGroupCountY,threadGroupCountZ,payload)
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.dispatchMesh.struct.Payload(i32, i32, i32, i32, %struct.Payload addrspace(3)*) #0
|
||||
|
||||
attributes #0 = { nounwind }
|
||||
|
||||
!llvm.ident = !{!0}
|
||||
!dx.version = !{!1}
|
||||
!dx.valver = !{!2}
|
||||
!dx.shaderModel = !{!3}
|
||||
!dx.entryPoints = !{!4}
|
||||
|
||||
!0 = !{!"dxcoob 1.9.2609.5 (01b62ad47)"}
|
||||
!1 = !{i32 1, i32 6}
|
||||
!2 = !{i32 1, i32 9}
|
||||
!3 = !{!"as", i32 6, i32 6}
|
||||
!4 = !{void ()* @as_main, !"as_main", null, null, !5}
|
||||
!5 = !{i32 10, !6}
|
||||
!6 = !{!7, i32 4}
|
||||
!7 = !{i32 1, i32 1, i32 1}
|
||||
!8 = !{!9, !9, i64 0}
|
||||
!9 = !{!"int", !10, i64 0}
|
||||
!10 = !{!"omnipotent char", !11, i64 0}
|
||||
!11 = !{!"Simple C/C++ TBAA"}
|
||||
|
||||
#endif
|
||||
|
||||
const unsigned char g_mesh_as[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x63, 0x72, 0x0e, 0xf7, 0x08, 0x85, 0x0d, 0x0f,
|
||||
0x8f, 0xbd, 0x8f, 0xc5, 0x53, 0xce, 0x45, 0xbd, 0x01, 0x00, 0x00, 0x00,
|
||||
0xc8, 0x09, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
|
||||
0xc4, 0x00, 0x00, 0x00, 0x20, 0x05, 0x00, 0x00, 0x3c, 0x05, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x53, 0x47, 0x31,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x50, 0x53, 0x56, 0x30, 0x50, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
0x00, 0x61, 0x73, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x54, 0x04, 0x00, 0x00,
|
||||
0x66, 0x00, 0x0e, 0x00, 0x15, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3c, 0x04, 0x00, 0x00,
|
||||
0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00,
|
||||
0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
|
||||
0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
|
||||
0x80, 0x10, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0x84, 0x10, 0x32, 0x14,
|
||||
0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x42, 0x88, 0x48, 0x90, 0x14, 0x20,
|
||||
0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
|
||||
0x11, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
|
||||
0x04, 0x21, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x88, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0x00, 0x00,
|
||||
0x49, 0x18, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x82, 0x00, 0x00,
|
||||
0x89, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x32, 0x22, 0x08, 0x09,
|
||||
0x20, 0x64, 0x85, 0x04, 0x13, 0x22, 0xa4, 0x84, 0x04, 0x13, 0x22, 0xe3,
|
||||
0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x88, 0x8c, 0x0b, 0x84, 0x84, 0x4c,
|
||||
0x10, 0x24, 0x73, 0x04, 0x60, 0x70, 0x8e, 0x34, 0x45, 0x94, 0x30, 0xf9,
|
||||
0x29, 0x80, 0x2d, 0x0e, 0x30, 0xa0, 0x00, 0x06, 0x11, 0x82, 0x61, 0x04,
|
||||
0xa0, 0x04, 0x43, 0x54, 0x8c, 0x01, 0x00, 0x10, 0xb2, 0x81, 0x00, 0x00,
|
||||
0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79,
|
||||
0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
|
||||
0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07,
|
||||
0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e,
|
||||
0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07,
|
||||
0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
|
||||
0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x3a, 0x0f, 0x24, 0x90, 0x21, 0x23,
|
||||
0x45, 0x44, 0x00, 0x76, 0x00, 0xf0, 0x90, 0x87, 0x00, 0x02, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x8f, 0x01, 0x04, 0x40,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x20, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x10, 0x19, 0x11, 0x4c, 0x90,
|
||||
0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x82, 0x12, 0x28, 0x86, 0x11,
|
||||
0x80, 0x42, 0x28, 0x83, 0x72, 0x28, 0x85, 0xa2, 0xa0, 0x98, 0x01, 0x00,
|
||||
0x79, 0x18, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
|
||||
0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
|
||||
0xc6, 0x25, 0xc7, 0x45, 0xc6, 0x06, 0x26, 0xc7, 0xa5, 0x06, 0x04, 0x05,
|
||||
0x26, 0x46, 0xcc, 0x46, 0x26, 0x8c, 0x8c, 0xe6, 0x26, 0x65, 0x43, 0x10,
|
||||
0x4c, 0x10, 0x80, 0x61, 0x82, 0x00, 0x10, 0x1b, 0x84, 0x81, 0x98, 0x20,
|
||||
0x00, 0xc5, 0x06, 0xc1, 0x30, 0x28, 0x84, 0xcd, 0x6d, 0x18, 0x10, 0x82,
|
||||
0x98, 0x20, 0x04, 0xcb, 0x04, 0x01, 0x30, 0x68, 0x8c, 0xbd, 0xb1, 0xbd,
|
||||
0xd5, 0xc9, 0x4d, 0x10, 0x80, 0x63, 0x82, 0x00, 0x20, 0x13, 0x04, 0x20,
|
||||
0xd9, 0x60, 0x10, 0x4c, 0x63, 0x38, 0xcf, 0x06, 0x61, 0x81, 0x36, 0x0c,
|
||||
0x86, 0x12, 0x4d, 0x10, 0x8a, 0x60, 0x03, 0xb0, 0x61, 0x18, 0x28, 0x6a,
|
||||
0x43, 0x50, 0x6d, 0x18, 0x86, 0xc9, 0xe2, 0x11, 0x36, 0xf7, 0xd5, 0x16,
|
||||
0x96, 0xe6, 0x36, 0x41, 0x00, 0x94, 0x0d, 0xc3, 0x30, 0x0c, 0x1b, 0x04,
|
||||
0x6d, 0xd9, 0x20, 0x64, 0xdb, 0x86, 0x62, 0xc2, 0x00, 0x80, 0x63, 0x91,
|
||||
0xe6, 0x36, 0x47, 0x37, 0xb7, 0x41, 0xf0, 0x9a, 0x2a, 0x6c, 0x6c, 0x76,
|
||||
0x6d, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x82, 0xa0, 0x0a, 0x19,
|
||||
0x9e, 0x8b, 0x5d, 0x99, 0xdc, 0x5c, 0xda, 0x9b, 0xdb, 0x94, 0x80, 0x68,
|
||||
0x42, 0x86, 0xe7, 0x62, 0x17, 0xc6, 0x66, 0x57, 0x26, 0x37, 0x25, 0x30,
|
||||
0xea, 0x90, 0xe1, 0xb9, 0xcc, 0xa1, 0x85, 0x91, 0x95, 0xc9, 0x35, 0xbd,
|
||||
0x91, 0x95, 0xb1, 0x4d, 0x09, 0x90, 0x4a, 0x64, 0x78, 0x2e, 0x74, 0x79,
|
||||
0x70, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x53, 0x84, 0xc8, 0xaa, 0x43, 0x86, 0xe7, 0x52, 0xe6, 0x46, 0x27,
|
||||
0x97, 0x07, 0xf5, 0x96, 0xe6, 0x46, 0x37, 0x37, 0x25, 0xe0, 0xba, 0x90,
|
||||
0xe1, 0xb9, 0x8c, 0xbd, 0xd5, 0xb9, 0xd1, 0x95, 0xc9, 0xcd, 0x4d, 0x09,
|
||||
0x3c, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
|
||||
0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
|
||||
0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
|
||||
0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
|
||||
0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
|
||||
0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
|
||||
0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
|
||||
0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
|
||||
0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
|
||||
0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
|
||||
0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
|
||||
0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
|
||||
0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
|
||||
0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
|
||||
0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
|
||||
0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
|
||||
0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
|
||||
0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
|
||||
0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
|
||||
0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
|
||||
0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
|
||||
0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8,
|
||||
0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a,
|
||||
0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e,
|
||||
0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x05, 0x90, 0x05, 0x7e, 0xe7, 0x2f, 0x3c, 0x9c, 0x67, 0xbf, 0xc3, 0x64,
|
||||
0x20, 0x70, 0x56, 0x85, 0x86, 0xf3, 0xec, 0x77, 0x98, 0x0c, 0x04, 0x06,
|
||||
0x2d, 0xe0, 0x00, 0xa4, 0x9f, 0x01, 0x90, 0xc6, 0x04, 0xc2, 0x60, 0xb8,
|
||||
0x7c, 0xe7, 0xf1, 0x07, 0x44, 0x7a, 0x80, 0x49, 0x38, 0x4c, 0x42, 0x3a,
|
||||
0x7c, 0x69, 0x8a, 0x28, 0x61, 0xf2, 0x53, 0x00, 0x5b, 0x1c, 0x60, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x09, 0xa9, 0x46, 0x0a, 0x69, 0x15, 0x14, 0x41,
|
||||
0xaa, 0xe6, 0x85, 0xce, 0x36, 0x42, 0xc2, 0x55, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x84, 0x04, 0x00, 0x00, 0x66, 0x00, 0x0e, 0x00, 0x21, 0x01, 0x00, 0x00,
|
||||
0x44, 0x58, 0x49, 0x4c, 0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x6c, 0x04, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
|
||||
0x18, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
|
||||
0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
|
||||
0x1e, 0x04, 0x8b, 0x62, 0x80, 0x10, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
|
||||
0x84, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x42, 0x88,
|
||||
0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
|
||||
0xe4, 0x48, 0x0e, 0x90, 0x11, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
|
||||
0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x21, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x1b, 0x88, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
|
||||
0x40, 0xda, 0x40, 0x08, 0x05, 0x70, 0x06, 0x00, 0x49, 0x18, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x00, 0x00, 0x00,
|
||||
0x89, 0x20, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x32, 0x22, 0x08, 0x09,
|
||||
0x20, 0x64, 0x85, 0x04, 0x13, 0x22, 0xa4, 0x84, 0x04, 0x13, 0x22, 0xe3,
|
||||
0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x88, 0x8c, 0x0b, 0x84, 0x84, 0x4c,
|
||||
0x10, 0x2c, 0x73, 0x04, 0x60, 0x70, 0x8e, 0x34, 0x45, 0x94, 0x30, 0xf9,
|
||||
0x29, 0x80, 0x2d, 0x0e, 0x30, 0xa0, 0x00, 0x06, 0x11, 0x82, 0x61, 0x04,
|
||||
0xa0, 0x04, 0x43, 0x54, 0x8c, 0x01, 0x00, 0x10, 0xb2, 0x81, 0x80, 0x41,
|
||||
0x04, 0x60, 0x98, 0x23, 0x00, 0x05, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0,
|
||||
0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0,
|
||||
0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d,
|
||||
0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a,
|
||||
0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73,
|
||||
0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74,
|
||||
0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6,
|
||||
0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76,
|
||||
0x40, 0x07, 0x3a, 0x0f, 0x24, 0x90, 0x21, 0x23, 0x45, 0x44, 0x00, 0x76,
|
||||
0x00, 0xf0, 0x90, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x80, 0x21, 0x8f, 0x01, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x59, 0x20, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x32, 0x1e, 0x98, 0x10, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47,
|
||||
0xc6, 0x04, 0x43, 0x82, 0x12, 0x28, 0x86, 0x92, 0x28, 0x8a, 0x42, 0x20,
|
||||
0x1d, 0x01, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec,
|
||||
0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45, 0xc6, 0x06, 0x26, 0xc7,
|
||||
0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46, 0x26, 0x8c, 0x8c, 0xe6,
|
||||
0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x80, 0x61, 0x82, 0x00, 0x10, 0x1b,
|
||||
0x84, 0x81, 0x98, 0x20, 0x00, 0xc5, 0x06, 0x61, 0x30, 0x28, 0x84, 0xcd,
|
||||
0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x14, 0x01, 0x8f, 0xb0, 0xb9, 0xaf,
|
||||
0xb6, 0xb0, 0x34, 0xb7, 0x09, 0x02, 0x60, 0x6c, 0x18, 0x86, 0x61, 0x98,
|
||||
0x20, 0x00, 0xc7, 0x06, 0xa1, 0x71, 0x36, 0x08, 0xcc, 0xb3, 0xa1, 0x50,
|
||||
0x16, 0x00, 0x80, 0x38, 0xa4, 0xb9, 0xd1, 0xf1, 0x79, 0x6b, 0x73, 0x4b,
|
||||
0x83, 0x7b, 0xa3, 0x2b, 0x73, 0xa3, 0x03, 0x19, 0x43, 0x0b, 0x93, 0x63,
|
||||
0x34, 0x95, 0xd6, 0x06, 0xc7, 0x56, 0x06, 0x32, 0xf4, 0x32, 0xb4, 0xb2,
|
||||
0x02, 0x42, 0x25, 0x14, 0x14, 0xb4, 0x21, 0xa0, 0x26, 0x08, 0x0a, 0xb2,
|
||||
0x61, 0x98, 0x2a, 0x6b, 0xc3, 0x20, 0x5d, 0xd6, 0x86, 0x01, 0xc3, 0xac,
|
||||
0x2a, 0x6c, 0x6c, 0x76, 0x6d, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x53,
|
||||
0x82, 0xa0, 0x0a, 0x19, 0x9e, 0x8b, 0x5d, 0x99, 0xdc, 0x5c, 0xda, 0x9b,
|
||||
0xdb, 0x94, 0x80, 0x68, 0x42, 0x86, 0xe7, 0x62, 0x17, 0xc6, 0x66, 0x57,
|
||||
0x26, 0x37, 0x25, 0x30, 0xea, 0x90, 0xe1, 0xb9, 0xcc, 0xa1, 0x85, 0x91,
|
||||
0x95, 0xc9, 0x35, 0xbd, 0x91, 0x95, 0xb1, 0x4d, 0x09, 0x90, 0x3a, 0x64,
|
||||
0x78, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74,
|
||||
0x73, 0x53, 0x02, 0x08, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
|
||||
0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
|
||||
0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
|
||||
0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
|
||||
0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
|
||||
0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
|
||||
0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
|
||||
0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
|
||||
0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
|
||||
0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
|
||||
0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
|
||||
0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
|
||||
0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
|
||||
0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
|
||||
0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
|
||||
0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
|
||||
0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
|
||||
0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
|
||||
0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
|
||||
0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
|
||||
0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
|
||||
0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8,
|
||||
0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a,
|
||||
0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e,
|
||||
0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x05, 0x90, 0x05, 0x7e, 0xe7, 0x2f, 0x3c, 0x9c, 0x67, 0xbf, 0xc3, 0x64,
|
||||
0x20, 0x70, 0x56, 0x85, 0x86, 0xf3, 0xec, 0x77, 0x98, 0x0c, 0x04, 0x06,
|
||||
0x2d, 0xe0, 0x00, 0xa4, 0x9f, 0x01, 0x90, 0xc6, 0x04, 0xc2, 0x60, 0xb8,
|
||||
0x7c, 0xe7, 0xf1, 0x07, 0x44, 0x7a, 0x80, 0x49, 0x38, 0x4c, 0x42, 0x3a,
|
||||
0x7c, 0x69, 0x8a, 0x28, 0x61, 0xf2, 0x53, 0x00, 0x5b, 0x1c, 0x60, 0x00,
|
||||
0x61, 0x20, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c,
|
||||
0x10, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x23, 0x00, 0x05,
|
||||
0x18, 0x50, 0xda, 0x02, 0x45, 0x40, 0x39, 0xd4, 0x11, 0x08, 0x00, 0x90,
|
||||
0x00, 0x09, 0x00, 0x00, 0xc3, 0x06, 0x44, 0x40, 0x0c, 0xc0, 0x88, 0x41,
|
||||
0x22, 0x80, 0x20, 0x18, 0x18, 0xcc, 0x20, 0x2c, 0x8b, 0x83, 0x01, 0x31,
|
||||
0x02, 0x00, 0x00, 0x00, 0x5b, 0x06, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
@@ -0,0 +1,462 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
//
|
||||
// GENERATED by DXC 1.9.2609 from mesh.hlsl by compile.sh; do not edit.
|
||||
|
||||
#if 0
|
||||
;
|
||||
; Input signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; no parameters
|
||||
;
|
||||
; Output signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; SV_Position 0 xyzw 0 POS float xyzw
|
||||
; COLOR 0 x 1 NONE uint x
|
||||
;
|
||||
; shader hash: 2510c16d61408eae7d2e2f4b80d23e9e
|
||||
;
|
||||
; Pipeline Runtime Information:
|
||||
;
|
||||
;PSVRuntimeInfo:
|
||||
; Mesh Shader
|
||||
; MeshOutputTopology=triangle
|
||||
; NumThreads=(3,1,1)
|
||||
; MinimumExpectedWaveLaneCount: 0
|
||||
; MaximumExpectedWaveLaneCount: 4294967295
|
||||
; UsesViewID: false
|
||||
; SigInputElements: 0
|
||||
; SigOutputElements: 2
|
||||
; SigPatchConstOrPrimElements: 0
|
||||
; SigInputVectors: 0
|
||||
; SigOutputVectors[0]: 2
|
||||
; SigOutputVectors[1]: 0
|
||||
; SigOutputVectors[2]: 0
|
||||
; SigOutputVectors[3]: 0
|
||||
; EntryFunctionName: ms_main
|
||||
;
|
||||
;
|
||||
; Vertex Output signature:
|
||||
;
|
||||
; Name Index InterpMode DynIdx
|
||||
; -------------------- ----- ---------------------- ------
|
||||
; SV_Position 0 noperspective
|
||||
; COLOR 0 nointerpolation
|
||||
;
|
||||
; Buffer Definitions:
|
||||
;
|
||||
;
|
||||
; Resource Bindings:
|
||||
;
|
||||
; Name Type Format Dim ID HLSL Bind Count
|
||||
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
|
||||
;
|
||||
;
|
||||
; ViewId state:
|
||||
;
|
||||
; Number of inputs: 0, outputs: 5, primitive outputs: 0
|
||||
; Outputs dependent on ViewId: { }
|
||||
; Primitive Outputs dependent on ViewId: { }
|
||||
; Inputs contributing to computation of Outputs:
|
||||
; Inputs contributing to computation of Primitive Outputs:
|
||||
;
|
||||
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
|
||||
target triple = "dxil-ms-dx"
|
||||
|
||||
%struct.Payload = type { i32 }
|
||||
|
||||
define void @ms_main() {
|
||||
%1 = call i32 @dx.op.groupId.i32(i32 94, i32 0) ; GroupId(component)
|
||||
%2 = call i32 @dx.op.threadIdInGroup.i32(i32 95, i32 0) ; ThreadIdInGroup(component)
|
||||
%3 = call %struct.Payload* @dx.op.getMeshPayload.struct.Payload(i32 170) ; GetMeshPayload()
|
||||
call void @dx.op.setMeshOutputCounts(i32 168, i32 3, i32 1) ; SetMeshOutputCounts(numVertices,numPrimitives)
|
||||
%4 = icmp eq i32 %1, 0
|
||||
%5 = select i1 %4, float -1.000000e+00, float 1.000000e+00
|
||||
%6 = select i1 %4, float 1.000000e+00, float -1.000000e+00
|
||||
%7 = icmp eq i32 %2, 0
|
||||
%8 = icmp eq i32 %2, 1
|
||||
%9 = select i1 %8, float %6, float %5
|
||||
%10 = icmp ult i32 %2, 2
|
||||
%11 = select i1 %10, float %5, float %6
|
||||
%12 = select i1 %7, float %5, float %9
|
||||
call void @dx.op.storeVertexOutput.f32(i32 171, i32 0, i32 0, i8 0, float %11, i32 %2) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex)
|
||||
call void @dx.op.storeVertexOutput.f32(i32 171, i32 0, i32 0, i8 1, float %12, i32 %2) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex)
|
||||
call void @dx.op.storeVertexOutput.f32(i32 171, i32 0, i32 0, i8 2, float 0.000000e+00, i32 %2) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex)
|
||||
call void @dx.op.storeVertexOutput.f32(i32 171, i32 0, i32 0, i8 3, float 1.000000e+00, i32 %2) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex)
|
||||
%13 = getelementptr inbounds %struct.Payload, %struct.Payload* %3, i32 0, i32 0
|
||||
%14 = load i32, i32* %13, align 4, !tbaa !16
|
||||
%15 = add i32 %14, %1
|
||||
call void @dx.op.storeVertexOutput.i32(i32 171, i32 1, i32 0, i8 0, i32 %15, i32 %2) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex)
|
||||
br i1 %7, label %16, label %17
|
||||
|
||||
; <label>:16 ; preds = %0
|
||||
call void @dx.op.emitIndices(i32 169, i32 0, i32 0, i32 1, i32 2) ; EmitIndices(PrimitiveIndex,VertexIndex0,VertexIndex1,VertexIndex2)
|
||||
br label %17
|
||||
|
||||
; <label>:17 ; preds = %16, %0
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.emitIndices(i32, i32, i32, i32, i32) #0
|
||||
|
||||
; Function Attrs: nounwind readonly
|
||||
declare %struct.Payload* @dx.op.getMeshPayload.struct.Payload(i32) #1
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare i32 @dx.op.threadIdInGroup.i32(i32, i32) #2
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare i32 @dx.op.groupId.i32(i32, i32) #2
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.storeVertexOutput.f32(i32, i32, i32, i8, float, i32) #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.storeVertexOutput.i32(i32, i32, i32, i8, i32, i32) #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.setMeshOutputCounts(i32, i32, i32) #0
|
||||
|
||||
attributes #0 = { nounwind }
|
||||
attributes #1 = { nounwind readonly }
|
||||
attributes #2 = { nounwind readnone }
|
||||
|
||||
!llvm.ident = !{!0}
|
||||
!dx.version = !{!1}
|
||||
!dx.valver = !{!2}
|
||||
!dx.shaderModel = !{!3}
|
||||
!dx.viewIdState = !{!4}
|
||||
!dx.entryPoints = !{!5}
|
||||
|
||||
!0 = !{!"dxcoob 1.9.2609.5 (01b62ad47)"}
|
||||
!1 = !{i32 1, i32 6}
|
||||
!2 = !{i32 1, i32 9}
|
||||
!3 = !{!"ms", i32 6, i32 6}
|
||||
!4 = !{[3 x i32] [i32 0, i32 5, i32 0]}
|
||||
!5 = !{void ()* @ms_main, !"ms_main", !6, null, !13}
|
||||
!6 = !{null, !7, null}
|
||||
!7 = !{!8, !11}
|
||||
!8 = !{i32 0, !"SV_Position", i8 9, i8 3, !9, i8 4, i32 1, i8 4, i32 0, i8 0, !10}
|
||||
!9 = !{i32 0}
|
||||
!10 = !{i32 3, i32 15}
|
||||
!11 = !{i32 1, !"COLOR", i8 5, i8 0, !9, i8 1, i32 1, i8 1, i32 1, i8 0, !12}
|
||||
!12 = !{i32 3, i32 1}
|
||||
!13 = !{i32 9, !14}
|
||||
!14 = !{!15, i32 3, i32 1, i32 2, i32 4}
|
||||
!15 = !{i32 3, i32 1, i32 1}
|
||||
!16 = !{!17, !17, i64 0}
|
||||
!17 = !{!"int", !18, i64 0}
|
||||
!18 = !{!"omnipotent char", !19, i64 0}
|
||||
!19 = !{!"Simple C/C++ TBAA"}
|
||||
|
||||
#endif
|
||||
|
||||
const unsigned char g_mesh_ms[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x60, 0x8d, 0xb9, 0x34, 0x73, 0x63, 0x46, 0x44,
|
||||
0xa5, 0xe6, 0xaf, 0x5e, 0x2b, 0xc0, 0xfd, 0xb4, 0x01, 0x00, 0x00, 0x00,
|
||||
0x34, 0x0e, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
|
||||
0x44, 0x01, 0x00, 0x00, 0x48, 0x07, 0x00, 0x00, 0x64, 0x07, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x53, 0x47, 0x31,
|
||||
0x5c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x00, 0x00,
|
||||
0x50, 0x53, 0x56, 0x30, 0x7c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0d, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x6d, 0x73, 0x5f, 0x6d, 0x61,
|
||||
0x69, 0x6e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x44, 0x03, 0x03, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x41, 0x00, 0x01, 0x01, 0x00, 0x00,
|
||||
0x53, 0x54, 0x41, 0x54, 0xfc, 0x05, 0x00, 0x00, 0x66, 0x00, 0x0d, 0x00,
|
||||
0x7f, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x06, 0x01, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0xe4, 0x05, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde,
|
||||
0x21, 0x0c, 0x00, 0x00, 0x76, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91,
|
||||
0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c,
|
||||
0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02,
|
||||
0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b,
|
||||
0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5,
|
||||
0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50,
|
||||
0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06,
|
||||
0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1b, 0x88, 0xe0, 0xff,
|
||||
0xff, 0xff, 0xff, 0x07, 0x40, 0xda, 0x60, 0x08, 0xff, 0xff, 0xff, 0xff,
|
||||
0x3f, 0x00, 0x12, 0x50, 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f,
|
||||
0x00, 0x09, 0xa0, 0x00, 0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00,
|
||||
0x89, 0x20, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09,
|
||||
0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3,
|
||||
0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c,
|
||||
0x10, 0x58, 0x23, 0x00, 0x25, 0x00, 0x14, 0xe6, 0x08, 0xc0, 0xa0, 0x18,
|
||||
0x60, 0x8c, 0x31, 0x06, 0x91, 0x73, 0xa4, 0x29, 0xa2, 0x84, 0xc9, 0x4f,
|
||||
0x01, 0x6c, 0x71, 0x80, 0x01, 0x05, 0x83, 0x4c, 0x11, 0xce, 0x20, 0x54,
|
||||
0x86, 0x31, 0x06, 0xa9, 0x39, 0x02, 0x64, 0x06, 0xa0, 0x1c, 0x60, 0x8c,
|
||||
0xc1, 0xda, 0x20, 0x57, 0x0e, 0x30, 0xc6, 0x60, 0x63, 0x10, 0x2c, 0x04,
|
||||
0x18, 0x63, 0x90, 0x1c, 0x08, 0xc8, 0x81, 0x01, 0x13, 0x14, 0x72, 0xc0,
|
||||
0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0,
|
||||
0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d,
|
||||
0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a,
|
||||
0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73,
|
||||
0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74,
|
||||
0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
|
||||
0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6,
|
||||
0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78,
|
||||
0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76,
|
||||
0x40, 0x07, 0x43, 0x9e, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x86, 0x3c, 0x04, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x28, 0x40, 0x00, 0x0c, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, 0x51, 0x80, 0x00, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xc8, 0xe3, 0x00, 0x01,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0x07, 0x02,
|
||||
0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x8f,
|
||||
0x04, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59,
|
||||
0x20, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14,
|
||||
0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x1a,
|
||||
0x25, 0x50, 0x0c, 0x23, 0x00, 0x85, 0x50, 0x06, 0xe5, 0x50, 0x0a, 0xe5,
|
||||
0x51, 0x12, 0x45, 0x50, 0x32, 0xc4, 0x4a, 0xa0, 0x24, 0xca, 0xa0, 0x10,
|
||||
0x46, 0x00, 0x4a, 0x81, 0xcc, 0x0c, 0x00, 0xd5, 0xb1, 0x06, 0xa0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec,
|
||||
0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45, 0xc6, 0x06, 0x26, 0xc7,
|
||||
0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46, 0x26, 0x8c, 0x8c, 0xe6,
|
||||
0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x06, 0x64, 0x82, 0x30, 0x24, 0x1b,
|
||||
0x84, 0x81, 0x98, 0x20, 0x0c, 0xca, 0x06, 0xc1, 0x30, 0x28, 0xb4, 0xcd,
|
||||
0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x18, 0xd9, 0x04, 0x61, 0x58, 0x68,
|
||||
0x8c, 0xbd, 0xb1, 0xbd, 0xd5, 0xc9, 0x4d, 0x10, 0x06, 0x66, 0x82, 0x30,
|
||||
0x34, 0x13, 0x84, 0xc1, 0xd9, 0x60, 0x10, 0x4c, 0x63, 0x38, 0xcf, 0x06,
|
||||
0x61, 0x81, 0x36, 0x0c, 0x86, 0x12, 0x4d, 0x10, 0x04, 0x60, 0x03, 0xb0,
|
||||
0x61, 0x30, 0x28, 0x6a, 0x43, 0x50, 0x6d, 0x18, 0x86, 0xc9, 0x9a, 0x20,
|
||||
0x54, 0xda, 0x86, 0x00, 0xe3, 0xd1, 0x36, 0xf7, 0xd5, 0x16, 0x96, 0xe6,
|
||||
0xc6, 0x65, 0xca, 0xea, 0x0b, 0xea, 0x6d, 0x2e, 0x8d, 0x2e, 0xed, 0xcd,
|
||||
0x6d, 0x82, 0xc0, 0x50, 0x13, 0x04, 0xa6, 0xda, 0x10, 0x18, 0x13, 0x04,
|
||||
0xc6, 0x9a, 0x20, 0x30, 0xd7, 0x04, 0x61, 0x78, 0x36, 0x08, 0x4d, 0x18,
|
||||
0x6c, 0x58, 0x8c, 0x8d, 0xeb, 0xbc, 0x6f, 0xf8, 0x0c, 0x30, 0x10, 0x03,
|
||||
0x16, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x13, 0x04, 0x06, 0x9b, 0x20, 0x30,
|
||||
0xd3, 0x06, 0xa1, 0x19, 0x36, 0x2c, 0x03, 0x19, 0x94, 0x01, 0x18, 0x78,
|
||||
0x66, 0x30, 0x98, 0xc1, 0x00, 0x06, 0x67, 0xb0, 0x41, 0x18, 0x03, 0x34,
|
||||
0xd8, 0x30, 0x00, 0x69, 0x00, 0x4c, 0x10, 0x06, 0x68, 0xc3, 0xd0, 0x0c,
|
||||
0xc3, 0x04, 0x61, 0x88, 0x36, 0x14, 0x6c, 0xd0, 0x0c, 0x6d, 0xb0, 0x6c,
|
||||
0x10, 0xd6, 0xc0, 0x0d, 0x36, 0x14, 0x93, 0xa6, 0x06, 0xc0, 0x1b, 0x10,
|
||||
0x11, 0x93, 0x0b, 0x73, 0x1b, 0x43, 0x2b, 0x9b, 0x63, 0x91, 0xe6, 0x36,
|
||||
0x47, 0x37, 0x37, 0x41, 0x18, 0x24, 0x12, 0x69, 0x6e, 0x74, 0x73, 0x34,
|
||||
0xe6, 0xd2, 0xce, 0xbe, 0xe6, 0xe8, 0x36, 0x20, 0x71, 0x30, 0xc8, 0xc1,
|
||||
0x1c, 0xd0, 0xc1, 0x53, 0x07, 0x4f, 0x15, 0x36, 0x36, 0xbb, 0x36, 0x97,
|
||||
0x34, 0xb2, 0x32, 0x37, 0xba, 0x29, 0x41, 0x50, 0x85, 0x0c, 0xcf, 0xc5,
|
||||
0xae, 0x4c, 0x6e, 0x2e, 0xed, 0xcd, 0x6d, 0x4a, 0x40, 0x34, 0x21, 0xc3,
|
||||
0x73, 0xb1, 0x0b, 0x63, 0xb3, 0x2b, 0x93, 0x9b, 0x12, 0x18, 0x75, 0xc8,
|
||||
0xf0, 0x5c, 0xe6, 0xd0, 0xc2, 0xc8, 0xca, 0xe4, 0x9a, 0xde, 0xc8, 0xca,
|
||||
0xd8, 0xa6, 0x04, 0x48, 0x25, 0x32, 0x3c, 0x17, 0xba, 0x3c, 0xb8, 0xb2,
|
||||
0x20, 0x37, 0xb7, 0x37, 0xba, 0x30, 0xba, 0xb4, 0x37, 0xb7, 0xb9, 0x29,
|
||||
0x42, 0x64, 0xd5, 0x21, 0xc3, 0x73, 0xb1, 0x4b, 0x2b, 0xbb, 0x4b, 0x22,
|
||||
0x9b, 0xa2, 0x0b, 0xa3, 0x2b, 0x9b, 0x12, 0x60, 0x75, 0xc8, 0xf0, 0x5c,
|
||||
0xca, 0xdc, 0xe8, 0xe4, 0xf2, 0xa0, 0xde, 0xd2, 0xdc, 0xe8, 0xe6, 0xa6,
|
||||
0x04, 0x6f, 0xd0, 0x85, 0x0c, 0xcf, 0x65, 0xec, 0xad, 0xce, 0x8d, 0xae,
|
||||
0x4c, 0x6e, 0x6e, 0x4a, 0x50, 0x07, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x51, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87,
|
||||
0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20,
|
||||
0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90,
|
||||
0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x30, 0x83, 0x81, 0xc8, 0x01, 0x1f, 0xdc,
|
||||
0x40, 0x1c, 0xe4, 0xa1, 0x1c, 0xc2, 0x61, 0x1d, 0xdc, 0x40, 0x1c, 0xe4,
|
||||
0x01, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x16, 0x10, 0x0d, 0x97, 0xef, 0x3c, 0x3e, 0xc1, 0x20, 0x93, 0xd8, 0x0c,
|
||||
0x88, 0x40, 0x48, 0x26, 0x30, 0x06, 0xc3, 0xe5, 0x3b, 0x8f, 0x6f, 0x10,
|
||||
0x93, 0x49, 0x48, 0x47, 0x0a, 0x60, 0x8b, 0x03, 0x0c, 0xbe, 0x34, 0x45,
|
||||
0x94, 0x30, 0xf9, 0x29, 0x80, 0x2d, 0x0e, 0x30, 0x18, 0x41, 0x34, 0x5c,
|
||||
0xbe, 0xf3, 0xf8, 0x46, 0xe4, 0x50, 0x8f, 0x38, 0xf8, 0xc8, 0x6d, 0xdb,
|
||||
0x41, 0x36, 0x5c, 0xbe, 0xf3, 0xf8, 0x12, 0x31, 0x99, 0x84, 0x74, 0xa0,
|
||||
0xd4, 0xf4, 0x50, 0x13, 0xe7, 0x50, 0xcd, 0x24, 0x59, 0xc1, 0x36, 0x5c,
|
||||
0xbe, 0xf3, 0xf8, 0xd2, 0xe4, 0x44, 0xc4, 0x4b, 0x44, 0x13, 0x71, 0xa1,
|
||||
0xd4, 0xf4, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x19, 0x6c, 0xc3, 0xe5, 0x3b,
|
||||
0x8f, 0x2f, 0x4d, 0x4e, 0x44, 0xbc, 0x44, 0x34, 0x11, 0x17, 0x4a, 0x4d,
|
||||
0x0f, 0x35, 0xf9, 0xc8, 0x6d, 0xdb, 0x40, 0x36, 0x5c, 0xbe, 0xf3, 0xf8,
|
||||
0xd3, 0x11, 0x11, 0xc0, 0x20, 0x0e, 0x62, 0x03, 0x46, 0x0e, 0xf5, 0xf8,
|
||||
0xc8, 0x6d, 0x1b, 0xc0, 0xc1, 0x48, 0x3f, 0x03, 0x20, 0x0d, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x25, 0x10, 0xc1, 0x6d, 0x61, 0x40, 0x8e, 0xae,
|
||||
0x7d, 0x2e, 0x2f, 0x4b, 0x80, 0xd2, 0x3e, 0x9e, 0x44, 0x58, 0x49, 0x4c,
|
||||
0xc8, 0x06, 0x00, 0x00, 0x66, 0x00, 0x0d, 0x00, 0xb2, 0x01, 0x00, 0x00,
|
||||
0x44, 0x58, 0x49, 0x4c, 0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0xb0, 0x06, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
|
||||
0xa9, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
|
||||
0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
|
||||
0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
|
||||
0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88,
|
||||
0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
|
||||
0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
|
||||
0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x1b, 0x88, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
|
||||
0x40, 0xda, 0x60, 0x08, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x12, 0x50,
|
||||
0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa0, 0x00,
|
||||
0x49, 0x18, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42,
|
||||
0x20, 0x4c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04,
|
||||
0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14,
|
||||
0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x68, 0x23, 0x00,
|
||||
0x25, 0x00, 0x14, 0xe6, 0x08, 0xc0, 0xa0, 0x18, 0x60, 0x8c, 0x31, 0x06,
|
||||
0x91, 0x73, 0xa4, 0x29, 0xa2, 0x84, 0xc9, 0x4f, 0x01, 0x6c, 0x71, 0x80,
|
||||
0x01, 0x05, 0x83, 0x4c, 0x11, 0xce, 0x20, 0x54, 0x86, 0x31, 0x06, 0xa9,
|
||||
0x39, 0x02, 0x64, 0x06, 0xa0, 0x1c, 0x60, 0x8c, 0xc1, 0xda, 0x20, 0x57,
|
||||
0x0e, 0x30, 0xc6, 0x60, 0x63, 0x10, 0x2c, 0x04, 0x18, 0x63, 0x90, 0x1c,
|
||||
0x08, 0xc8, 0x81, 0x31, 0x47, 0x10, 0xd0, 0x98, 0x23, 0x00, 0x85, 0x29,
|
||||
0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
|
||||
0x3c, 0x04, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x79, 0x10, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0xf2, 0x28, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0xe4, 0x51, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x60, 0xc8, 0xe3, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0x07, 0x02, 0x02, 0x20, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x8f, 0x04, 0x04, 0x40, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x20, 0x00, 0x00, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
|
||||
0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x1a, 0x25, 0x50, 0x0c, 0x25,
|
||||
0x31, 0x02, 0x50, 0x06, 0xe5, 0x51, 0x04, 0x85, 0x40, 0xac, 0x24, 0xca,
|
||||
0xa0, 0x10, 0x46, 0x00, 0x4a, 0xa1, 0x04, 0x08, 0x8f, 0x00, 0x50, 0x1d,
|
||||
0x6b, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x59, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4,
|
||||
0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45,
|
||||
0xc6, 0x06, 0x26, 0xc7, 0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46,
|
||||
0x26, 0x8c, 0x8c, 0xe6, 0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x06, 0x64,
|
||||
0x82, 0x30, 0x24, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x0c, 0xca, 0x06, 0x61,
|
||||
0x30, 0x28, 0xb4, 0xcd, 0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x54, 0xd7,
|
||||
0x86, 0x40, 0x99, 0x20, 0x08, 0x00, 0x8f, 0xb6, 0xb9, 0xaf, 0xb6, 0xb0,
|
||||
0x34, 0xb7, 0x09, 0xc2, 0xb0, 0x70, 0x99, 0xb2, 0xfa, 0x82, 0x7a, 0x9b,
|
||||
0x4b, 0xa3, 0x4b, 0x7b, 0x73, 0x9b, 0x20, 0x30, 0xd0, 0x04, 0x81, 0x89,
|
||||
0x36, 0x04, 0xce, 0x04, 0x81, 0x91, 0x26, 0x08, 0xcc, 0x34, 0x41, 0x18,
|
||||
0x98, 0x09, 0xc2, 0xd0, 0x6c, 0x10, 0x2a, 0x6b, 0xc3, 0xe2, 0x3c, 0x50,
|
||||
0x24, 0x4d, 0xc3, 0xe4, 0x50, 0x17, 0x8b, 0xa1, 0x27, 0xa6, 0x27, 0xa9,
|
||||
0x09, 0x02, 0x43, 0x4d, 0x10, 0x98, 0x6a, 0x83, 0x50, 0x0d, 0x1b, 0x96,
|
||||
0x21, 0xd3, 0x28, 0x69, 0x1b, 0xb6, 0x81, 0xe2, 0x36, 0x08, 0x58, 0xb7,
|
||||
0x61, 0x00, 0x3c, 0x60, 0xc3, 0x50, 0x0d, 0xc3, 0x04, 0x61, 0x70, 0x26,
|
||||
0x08, 0xc3, 0xb3, 0xa1, 0x00, 0x83, 0x6a, 0x08, 0x03, 0x31, 0xd8, 0x20,
|
||||
0x18, 0x63, 0xb0, 0xa1, 0x60, 0x9a, 0x0f, 0x20, 0x03, 0x0e, 0x69, 0x6e,
|
||||
0x74, 0x7c, 0xde, 0xda, 0xdc, 0xd2, 0xe0, 0xde, 0xe8, 0xca, 0xdc, 0xe8,
|
||||
0x40, 0xc6, 0xd0, 0xc2, 0xe4, 0x18, 0x4d, 0xa5, 0xb5, 0xc1, 0xb1, 0x95,
|
||||
0x81, 0x0c, 0xbd, 0x0c, 0xad, 0xac, 0x80, 0x50, 0x09, 0x05, 0x05, 0x6d,
|
||||
0x08, 0xd0, 0x60, 0x82, 0x80, 0x59, 0x1b, 0x86, 0x33, 0x48, 0x03, 0x35,
|
||||
0xd8, 0x30, 0x98, 0xc1, 0x1a, 0xa8, 0xc1, 0x86, 0x81, 0x0d, 0xd8, 0x40,
|
||||
0x0d, 0xaa, 0xb0, 0xb1, 0xd9, 0xb5, 0xb9, 0xa4, 0x91, 0x95, 0xb9, 0xd1,
|
||||
0x4d, 0x09, 0x82, 0x2a, 0x64, 0x78, 0x2e, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x53, 0x02, 0xa2, 0x09, 0x19, 0x9e, 0x8b, 0x5d, 0x18, 0x9b,
|
||||
0x5d, 0x99, 0xdc, 0x94, 0xc0, 0xa8, 0x43, 0x86, 0xe7, 0x32, 0x87, 0x16,
|
||||
0x46, 0x56, 0x26, 0xd7, 0xf4, 0x46, 0x56, 0xc6, 0x36, 0x25, 0x40, 0xea,
|
||||
0x90, 0xe1, 0xb9, 0xd8, 0xa5, 0x95, 0xdd, 0x25, 0x91, 0x4d, 0xd1, 0x85,
|
||||
0xd1, 0x95, 0x4d, 0x09, 0x94, 0x3a, 0x64, 0x78, 0x2e, 0x65, 0x6e, 0x74,
|
||||
0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x53, 0x02, 0x32, 0x00,
|
||||
0x79, 0x18, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c,
|
||||
0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3,
|
||||
0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6,
|
||||
0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e,
|
||||
0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43,
|
||||
0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03,
|
||||
0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48,
|
||||
0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20,
|
||||
0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e,
|
||||
0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d,
|
||||
0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89,
|
||||
0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83,
|
||||
0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68,
|
||||
0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90,
|
||||
0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78,
|
||||
0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98,
|
||||
0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5,
|
||||
0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c,
|
||||
0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c,
|
||||
0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43,
|
||||
0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43,
|
||||
0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82,
|
||||
0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70,
|
||||
0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8,
|
||||
0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2,
|
||||
0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x30, 0x83, 0x81,
|
||||
0xc8, 0x01, 0x1f, 0xdc, 0x40, 0x1c, 0xe4, 0xa1, 0x1c, 0xc2, 0x61, 0x1d,
|
||||
0xdc, 0x40, 0x1c, 0xe4, 0x01, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00,
|
||||
0x27, 0x00, 0x00, 0x00, 0x16, 0x10, 0x0d, 0x97, 0xef, 0x3c, 0x3e, 0xc1,
|
||||
0x20, 0x93, 0xd8, 0x0c, 0x88, 0x40, 0x48, 0x26, 0x30, 0x06, 0xc3, 0xe5,
|
||||
0x3b, 0x8f, 0x6f, 0x10, 0x93, 0x49, 0x48, 0x47, 0x0a, 0x60, 0x8b, 0x03,
|
||||
0x0c, 0xbe, 0x34, 0x45, 0x94, 0x30, 0xf9, 0x29, 0x80, 0x2d, 0x0e, 0x30,
|
||||
0x18, 0x41, 0x34, 0x5c, 0xbe, 0xf3, 0xf8, 0x46, 0xe4, 0x50, 0x8f, 0x38,
|
||||
0xf8, 0xc8, 0x6d, 0xdb, 0x41, 0x36, 0x5c, 0xbe, 0xf3, 0xf8, 0x12, 0x31,
|
||||
0x99, 0x84, 0x74, 0xa0, 0xd4, 0xf4, 0x50, 0x13, 0xe7, 0x50, 0xcd, 0x24,
|
||||
0x59, 0xc1, 0x36, 0x5c, 0xbe, 0xf3, 0xf8, 0xd2, 0xe4, 0x44, 0xc4, 0x4b,
|
||||
0x44, 0x13, 0x71, 0xa1, 0xd4, 0xf4, 0x50, 0x93, 0x5f, 0xdc, 0xb6, 0x19,
|
||||
0x6c, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x4d, 0x4e, 0x44, 0xbc, 0x44, 0x34,
|
||||
0x11, 0x17, 0x4a, 0x4d, 0x0f, 0x35, 0xf9, 0xc8, 0x6d, 0xdb, 0x40, 0x36,
|
||||
0x5c, 0xbe, 0xf3, 0xf8, 0xd3, 0x11, 0x11, 0xc0, 0x20, 0x0e, 0x62, 0x03,
|
||||
0x46, 0x0e, 0xf5, 0xf8, 0xc8, 0x6d, 0x1b, 0xc0, 0xc1, 0x48, 0x3f, 0x03,
|
||||
0x20, 0x0d, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00,
|
||||
0x13, 0x04, 0x43, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x34, 0xca, 0x5a, 0xa0, 0x78, 0x03, 0xca, 0x37, 0xa0, 0xa8, 0x05, 0x0a,
|
||||
0x5a, 0xa0, 0xa4, 0x05, 0x88, 0x15, 0x01, 0xb5, 0x31, 0x02, 0x10, 0x04,
|
||||
0x41, 0xfc, 0x1b, 0x23, 0x00, 0x41, 0x10, 0xc4, 0x7f, 0x61, 0x04, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x23, 0x06, 0x06, 0x00, 0x82, 0x60, 0xa0, 0x78,
|
||||
0xc9, 0x35, 0x62, 0x60, 0x00, 0x20, 0x08, 0x06, 0x0a, 0x18, 0x24, 0xd8,
|
||||
0x88, 0x41, 0x01, 0x80, 0x20, 0x18, 0x20, 0x62, 0x90, 0x8c, 0x18, 0x1c,
|
||||
0x00, 0x08, 0x82, 0x81, 0xe4, 0x25, 0x59, 0x37, 0xdc, 0x30, 0x68, 0x60,
|
||||
0x30, 0xdd, 0x60, 0x1c, 0xc1, 0x74, 0x03, 0x72, 0x08, 0xc3, 0x0d, 0x45,
|
||||
0x07, 0x06, 0xc3, 0x0d, 0x46, 0x18, 0x80, 0xc1, 0x74, 0xc3, 0x40, 0x04,
|
||||
0xc3, 0x0d, 0x48, 0x47, 0x06, 0xd3, 0x0d, 0x46, 0x11, 0x4c, 0x37, 0x1c,
|
||||
0x43, 0x31, 0x62, 0xa0, 0x00, 0x20, 0x08, 0x06, 0x4e, 0x1a, 0x58, 0x63,
|
||||
0x30, 0x06, 0x9b, 0xb0, 0x8c, 0x18, 0x28, 0x00, 0x08, 0x82, 0x81, 0x93,
|
||||
0x06, 0xd6, 0x18, 0x8c, 0x41, 0x16, 0x2c, 0x23, 0x06, 0x0a, 0x00, 0x82,
|
||||
0x60, 0xe0, 0xa4, 0x81, 0x35, 0x06, 0x63, 0x00, 0x35, 0xcb, 0x88, 0x81,
|
||||
0x02, 0x80, 0x20, 0x18, 0x38, 0x69, 0x60, 0x8d, 0xc1, 0x18, 0x74, 0xcf,
|
||||
0xb2, 0xcd, 0xa0, 0x8c, 0xc1, 0x18, 0x50, 0x30, 0x46, 0x05, 0x0e, 0x8c,
|
||||
0x18, 0x28, 0x00, 0x08, 0x82, 0x01, 0xb4, 0x06, 0x59, 0x1a, 0x98, 0x81,
|
||||
0x17, 0x38, 0xb3, 0x0c, 0x81, 0x90, 0x8c, 0x18, 0x24, 0x00, 0x08, 0x82,
|
||||
0x01, 0x01, 0x07, 0x94, 0x19, 0x98, 0x41, 0x1a, 0x8c, 0xc1, 0x2c, 0x81,
|
||||
0x80, 0x01, 0x31, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5b, 0x06, 0x29, 0x60,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
@@ -0,0 +1,354 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
//
|
||||
// GENERATED by DXC 1.9.2609 from mesh.hlsl by compile.sh; do not edit.
|
||||
|
||||
#if 0
|
||||
;
|
||||
; Input signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; SV_Position 0 xyzw 0 POS float
|
||||
; COLOR 0 x 1 NONE uint x
|
||||
;
|
||||
;
|
||||
; Output signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; SV_Target 0 x 0 TARGET uint x
|
||||
;
|
||||
; shader hash: 160420bd0099533dc20c0e6886f7806a
|
||||
;
|
||||
; Pipeline Runtime Information:
|
||||
;
|
||||
;PSVRuntimeInfo:
|
||||
; Pixel Shader
|
||||
; DepthOutput=0
|
||||
; SampleFrequency=0
|
||||
; MinimumExpectedWaveLaneCount: 0
|
||||
; MaximumExpectedWaveLaneCount: 4294967295
|
||||
; UsesViewID: false
|
||||
; SigInputElements: 2
|
||||
; SigOutputElements: 1
|
||||
; SigPatchConstOrPrimElements: 0
|
||||
; SigInputVectors: 2
|
||||
; SigOutputVectors[0]: 1
|
||||
; SigOutputVectors[1]: 0
|
||||
; SigOutputVectors[2]: 0
|
||||
; SigOutputVectors[3]: 0
|
||||
; EntryFunctionName: ps_main
|
||||
;
|
||||
;
|
||||
; Input signature:
|
||||
;
|
||||
; Name Index InterpMode DynIdx
|
||||
; -------------------- ----- ---------------------- ------
|
||||
; SV_Position 0 noperspective
|
||||
; COLOR 0 nointerpolation
|
||||
;
|
||||
; Output signature:
|
||||
;
|
||||
; Name Index InterpMode DynIdx
|
||||
; -------------------- ----- ---------------------- ------
|
||||
; SV_Target 0
|
||||
;
|
||||
; Buffer Definitions:
|
||||
;
|
||||
;
|
||||
; Resource Bindings:
|
||||
;
|
||||
; Name Type Format Dim ID HLSL Bind Count
|
||||
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
|
||||
;
|
||||
;
|
||||
; ViewId state:
|
||||
;
|
||||
; Number of inputs: 5, outputs: 1
|
||||
; Outputs dependent on ViewId: { }
|
||||
; Inputs contributing to computation of Outputs:
|
||||
; output 0 depends on inputs: { 4 }
|
||||
;
|
||||
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
|
||||
target triple = "dxil-ms-dx"
|
||||
|
||||
define void @ps_main() {
|
||||
%1 = call i32 @dx.op.loadInput.i32(i32 4, i32 1, i32 0, i8 0, i32 undef) ; LoadInput(inputSigId,rowIndex,colIndex,gsVertexAxis)
|
||||
call void @dx.op.storeOutput.i32(i32 5, i32 0, i32 0, i8 0, i32 %1) ; StoreOutput(outputSigId,rowIndex,colIndex,value)
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare i32 @dx.op.loadInput.i32(i32, i32, i32, i8, i32) #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.storeOutput.i32(i32, i32, i32, i8, i32) #1
|
||||
|
||||
attributes #0 = { nounwind readnone }
|
||||
attributes #1 = { nounwind }
|
||||
|
||||
!llvm.ident = !{!0}
|
||||
!dx.version = !{!1}
|
||||
!dx.valver = !{!2}
|
||||
!dx.shaderModel = !{!3}
|
||||
!dx.viewIdState = !{!4}
|
||||
!dx.entryPoints = !{!5}
|
||||
|
||||
!0 = !{!"dxcoob 1.9.2609.5 (01b62ad47)"}
|
||||
!1 = !{i32 1, i32 6}
|
||||
!2 = !{i32 1, i32 9}
|
||||
!3 = !{!"ps", i32 6, i32 6}
|
||||
!4 = !{[7 x i32] [i32 5, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1]}
|
||||
!5 = !{void ()* @ps_main, !"ps_main", !6, null, null}
|
||||
!6 = !{!7, !12, null}
|
||||
!7 = !{!8, !10}
|
||||
!8 = !{i32 0, !"SV_Position", i8 9, i8 3, !9, i8 4, i32 1, i8 4, i32 0, i8 0, null}
|
||||
!9 = !{i32 0}
|
||||
!10 = !{i32 1, !"COLOR", i8 5, i8 0, !9, i8 1, i32 1, i8 1, i32 1, i8 0, !11}
|
||||
!11 = !{i32 3, i32 1}
|
||||
!12 = !{!13}
|
||||
!13 = !{i32 0, !"SV_Target", i8 5, i8 16, !9, i8 0, i32 1, i8 1, i32 0, i8 0, !11}
|
||||
|
||||
#endif
|
||||
|
||||
const unsigned char g_mesh_ps[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x5c, 0x1f, 0x97, 0x75, 0x4e, 0x5a, 0xc6, 0x68,
|
||||
0x71, 0x4f, 0xbc, 0x67, 0xfe, 0xcd, 0xdd, 0xf4, 0x01, 0x00, 0x00, 0x00,
|
||||
0x34, 0x0b, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0xec, 0x00, 0x00, 0x00,
|
||||
0xa0, 0x01, 0x00, 0x00, 0x64, 0x06, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x5c, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00,
|
||||
0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x00, 0x00, 0x4f, 0x53, 0x47, 0x31,
|
||||
0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54,
|
||||
0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0x00, 0x00, 0x50, 0x53, 0x56, 0x30,
|
||||
0xac, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
|
||||
0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4f, 0x4c,
|
||||
0x4f, 0x52, 0x00, 0x70, 0x73, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x44, 0x03,
|
||||
0x03, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x41, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x10, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54,
|
||||
0xbc, 0x04, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x2f, 0x01, 0x00, 0x00,
|
||||
0x44, 0x58, 0x49, 0x4c, 0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0xa4, 0x04, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
|
||||
0x26, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
|
||||
0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
|
||||
0x1e, 0x04, 0x8b, 0x62, 0x80, 0x10, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
|
||||
0x84, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x42, 0x88,
|
||||
0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
|
||||
0xe4, 0x48, 0x0e, 0x90, 0x11, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
|
||||
0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x21, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
|
||||
0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20,
|
||||
0x01, 0x00, 0x00, 0x00, 0x49, 0x18, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x82, 0x60, 0x42, 0x20, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x32, 0x22, 0x08, 0x09, 0x20, 0x64, 0x85, 0x04,
|
||||
0x13, 0x22, 0xa4, 0x84, 0x04, 0x13, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14,
|
||||
0x12, 0x4c, 0x88, 0x8c, 0x0b, 0x84, 0x84, 0x4c, 0x10, 0x2c, 0x23, 0x00,
|
||||
0x25, 0x00, 0x8a, 0x39, 0x02, 0x30, 0x98, 0x23, 0x40, 0x8a, 0x31, 0x33,
|
||||
0x43, 0x43, 0x55, 0x0c, 0x98, 0x19, 0x1a, 0xba, 0x81, 0x80, 0x3c, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e,
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
|
||||
0x3c, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x79, 0x0e, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xc8, 0x02, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x10,
|
||||
0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x9a,
|
||||
0x12, 0x28, 0x86, 0x11, 0x80, 0x32, 0x20, 0x2a, 0x89, 0x32, 0x28, 0x84,
|
||||
0x11, 0x80, 0x52, 0x28, 0x81, 0x02, 0x21, 0x1d, 0xeb, 0x28, 0x02, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x8e, 0x0c, 0x6f, 0xec,
|
||||
0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45, 0xc6, 0x06, 0x26, 0xc7,
|
||||
0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46, 0x26, 0x8c, 0x8c, 0xe6,
|
||||
0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x86, 0x61, 0x82, 0x30, 0x10, 0x1b,
|
||||
0x84, 0x81, 0x98, 0x20, 0x0c, 0xc5, 0x06, 0xc1, 0x30, 0x28, 0xc0, 0xcd,
|
||||
0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x08, 0xc0, 0x06, 0x60, 0xc3, 0x60,
|
||||
0x2c, 0xcb, 0x86, 0x80, 0xd9, 0x30, 0x0c, 0x4a, 0x33, 0x41, 0x50, 0x9c,
|
||||
0x0d, 0xc1, 0xc3, 0x03, 0x6e, 0xee, 0xab, 0x2d, 0x2c, 0xcd, 0x8d, 0xcb,
|
||||
0x94, 0xd5, 0x17, 0xd4, 0xdb, 0x5c, 0x1a, 0x5d, 0xda, 0x9b, 0xdb, 0x04,
|
||||
0x81, 0x38, 0x26, 0x08, 0x04, 0xb2, 0x21, 0x30, 0x26, 0x08, 0x44, 0x32,
|
||||
0x41, 0x20, 0x94, 0x0d, 0x8b, 0x21, 0x4d, 0x54, 0x65, 0x0d, 0x96, 0x71,
|
||||
0x01, 0x2c, 0x86, 0x9e, 0x98, 0x9e, 0xa4, 0x26, 0x08, 0xc4, 0x32, 0x41,
|
||||
0x20, 0x98, 0x09, 0xc2, 0x60, 0x6c, 0x10, 0xb8, 0x61, 0xc3, 0x32, 0x64,
|
||||
0xda, 0x55, 0x6d, 0xc3, 0x36, 0x5c, 0xdd, 0x06, 0x01, 0xf3, 0x98, 0x4c,
|
||||
0x59, 0x7d, 0x51, 0x85, 0xc9, 0x9d, 0x95, 0xd1, 0x4d, 0x10, 0x88, 0x66,
|
||||
0xc3, 0x62, 0x80, 0x81, 0x16, 0x06, 0xd5, 0x35, 0x6c, 0xc6, 0xd5, 0x6d,
|
||||
0x08, 0xc4, 0x60, 0xc3, 0xf0, 0x8d, 0x01, 0xb0, 0xa1, 0x50, 0x22, 0x32,
|
||||
0x00, 0x00, 0x16, 0x69, 0x6e, 0x73, 0x74, 0x73, 0x34, 0xe6, 0xd2, 0xce,
|
||||
0xbe, 0xd8, 0xc8, 0x68, 0xcc, 0xa5, 0x9d, 0x7d, 0xcd, 0xd1, 0x6d, 0x30,
|
||||
0xcc, 0x80, 0x3b, 0x83, 0x01, 0x0d, 0x86, 0x2a, 0x6c, 0x6c, 0x76, 0x6d,
|
||||
0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x82, 0xa0, 0x0a, 0x19, 0x9e,
|
||||
0x8b, 0x5d, 0x99, 0xdc, 0x5c, 0xda, 0x9b, 0xdb, 0x94, 0x80, 0x68, 0x42,
|
||||
0x86, 0xe7, 0x62, 0x17, 0xc6, 0x66, 0x57, 0x26, 0x37, 0x25, 0x30, 0xea,
|
||||
0x90, 0xe1, 0xb9, 0xcc, 0xa1, 0x85, 0x91, 0x95, 0xc9, 0x35, 0xbd, 0x91,
|
||||
0x95, 0xb1, 0x4d, 0x09, 0x90, 0x4a, 0x64, 0x78, 0x2e, 0x74, 0x79, 0x70,
|
||||
0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x53, 0x82, 0xa6, 0x0e, 0x19, 0x9e, 0x8b, 0x5d, 0x5a, 0xd9, 0x5d, 0x12,
|
||||
0xd9, 0x14, 0x5d, 0x18, 0x5d, 0xd9, 0x94, 0xe0, 0xa9, 0x43, 0x86, 0xe7,
|
||||
0x52, 0xe6, 0x46, 0x27, 0x97, 0x07, 0xf5, 0x96, 0xe6, 0x46, 0x37, 0x37,
|
||||
0x25, 0x20, 0x83, 0x2e, 0x64, 0x78, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x65, 0x72, 0x73, 0x53, 0x02, 0x34, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87,
|
||||
0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20,
|
||||
0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90,
|
||||
0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x16, 0x30, 0x0d, 0x97, 0xef, 0x3c, 0xfe, 0xe2,
|
||||
0x00, 0x83, 0xd8, 0x3c, 0xd4, 0xe4, 0x23, 0xb7, 0x6d, 0x02, 0xd5, 0x70,
|
||||
0xf9, 0xce, 0xe3, 0x4b, 0x93, 0x13, 0x11, 0x28, 0x35, 0x3d, 0xd4, 0xe4,
|
||||
0x23, 0xb7, 0x6d, 0x00, 0xc7, 0x23, 0xfd, 0x0c, 0x80, 0x34, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x16, 0x04, 0x20, 0xbd, 0x00, 0x99, 0x53, 0x3d,
|
||||
0xc2, 0x0c, 0x0e, 0x68, 0x86, 0xf7, 0x80, 0x6a, 0x44, 0x58, 0x49, 0x4c,
|
||||
0xac, 0x04, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00,
|
||||
0x44, 0x58, 0x49, 0x4c, 0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x94, 0x04, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
|
||||
0x22, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
|
||||
0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
|
||||
0x1e, 0x04, 0x8b, 0x62, 0x80, 0x10, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
|
||||
0x84, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x42, 0x88,
|
||||
0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
|
||||
0xe4, 0x48, 0x0e, 0x90, 0x11, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
|
||||
0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x21, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07,
|
||||
0x40, 0x02, 0xa8, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20,
|
||||
0x01, 0x00, 0x00, 0x00, 0x49, 0x18, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x13, 0x82, 0x60, 0x42, 0x20, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x32, 0x22, 0x08, 0x09, 0x20, 0x64, 0x85, 0x04,
|
||||
0x13, 0x22, 0xa4, 0x84, 0x04, 0x13, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14,
|
||||
0x12, 0x4c, 0x88, 0x8c, 0x0b, 0x84, 0x84, 0x4c, 0x10, 0x2c, 0x23, 0x00,
|
||||
0x25, 0x00, 0x8a, 0x39, 0x02, 0x30, 0x98, 0x23, 0x40, 0x8a, 0x31, 0x33,
|
||||
0x43, 0x43, 0x55, 0x0c, 0x98, 0x19, 0x1a, 0xba, 0x81, 0x80, 0x3c, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
|
||||
0x3c, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x79, 0x0e, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xc8, 0x02, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14,
|
||||
0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x9a,
|
||||
0x12, 0x28, 0x86, 0x92, 0x18, 0x01, 0x28, 0x03, 0xa2, 0x92, 0x28, 0x83,
|
||||
0x42, 0x18, 0x01, 0x28, 0x85, 0x12, 0x28, 0x10, 0xd2, 0xb1, 0x8e, 0x22,
|
||||
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x49, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4,
|
||||
0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45,
|
||||
0xc6, 0x06, 0x26, 0xc7, 0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46,
|
||||
0x26, 0x8c, 0x8c, 0xe6, 0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x86, 0x61,
|
||||
0x82, 0x30, 0x10, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x0c, 0xc5, 0x06, 0x61,
|
||||
0x30, 0x28, 0xc0, 0xcd, 0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x28, 0xcf,
|
||||
0x86, 0x40, 0x99, 0x20, 0x08, 0x00, 0x0f, 0xb8, 0xb9, 0xaf, 0xb6, 0xb0,
|
||||
0x34, 0xb7, 0x09, 0xc2, 0x60, 0x70, 0x99, 0xb2, 0xfa, 0x82, 0x7a, 0x9b,
|
||||
0x4b, 0xa3, 0x4b, 0x7b, 0x73, 0x9b, 0x20, 0x10, 0xc8, 0x04, 0x81, 0x48,
|
||||
0x36, 0x04, 0xce, 0x04, 0x81, 0x50, 0x26, 0x08, 0xc4, 0xb2, 0x61, 0x71,
|
||||
0x1e, 0x28, 0x92, 0xa6, 0x61, 0x72, 0x28, 0x80, 0xc5, 0xd0, 0x13, 0xd3,
|
||||
0x93, 0xd4, 0x04, 0x81, 0x60, 0x26, 0x08, 0x44, 0x33, 0x41, 0x18, 0x8e,
|
||||
0x0d, 0x42, 0x36, 0x6c, 0x58, 0x06, 0xeb, 0xa2, 0x24, 0x6c, 0xc0, 0x06,
|
||||
0x4a, 0xdb, 0x20, 0x54, 0x1b, 0x93, 0x29, 0xab, 0x2f, 0xaa, 0x30, 0xb9,
|
||||
0xb3, 0x32, 0xba, 0x09, 0x02, 0xe1, 0x6c, 0x58, 0x9c, 0xee, 0xf2, 0x24,
|
||||
0x6a, 0xc0, 0x1c, 0x4a, 0xdb, 0x10, 0x7c, 0x1b, 0x06, 0x0e, 0x0c, 0x80,
|
||||
0x0d, 0x05, 0xd3, 0x84, 0x01, 0x00, 0x54, 0x61, 0x63, 0xb3, 0x6b, 0x73,
|
||||
0x49, 0x23, 0x2b, 0x73, 0xa3, 0x9b, 0x12, 0x04, 0x55, 0xc8, 0xf0, 0x5c,
|
||||
0xec, 0xca, 0xe4, 0xe6, 0xd2, 0xde, 0xdc, 0xa6, 0x04, 0x44, 0x13, 0x32,
|
||||
0x3c, 0x17, 0xbb, 0x30, 0x36, 0xbb, 0x32, 0xb9, 0x29, 0x81, 0x51, 0x87,
|
||||
0x0c, 0xcf, 0x65, 0x0e, 0x2d, 0x8c, 0xac, 0x4c, 0xae, 0xe9, 0x8d, 0xac,
|
||||
0x8c, 0x6d, 0x4a, 0x80, 0xd4, 0x21, 0xc3, 0x73, 0xb1, 0x4b, 0x2b, 0xbb,
|
||||
0x4b, 0x22, 0x9b, 0xa2, 0x0b, 0xa3, 0x2b, 0x9b, 0x12, 0x28, 0x75, 0xc8,
|
||||
0xf0, 0x5c, 0xca, 0xdc, 0xe8, 0xe4, 0xf2, 0xa0, 0xde, 0xd2, 0xdc, 0xe8,
|
||||
0xe6, 0xa6, 0x04, 0x61, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87,
|
||||
0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20,
|
||||
0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90,
|
||||
0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x16, 0x30, 0x0d, 0x97, 0xef, 0x3c, 0xfe, 0xe2,
|
||||
0x00, 0x83, 0xd8, 0x3c, 0xd4, 0xe4, 0x23, 0xb7, 0x6d, 0x02, 0xd5, 0x70,
|
||||
0xf9, 0xce, 0xe3, 0x4b, 0x93, 0x13, 0x11, 0x28, 0x35, 0x3d, 0xd4, 0xe4,
|
||||
0x23, 0xb7, 0x6d, 0x00, 0xc7, 0x23, 0xfd, 0x0c, 0x80, 0x34, 0x00, 0x00,
|
||||
0x61, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c,
|
||||
0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x34, 0x85, 0x30, 0x03,
|
||||
0x50, 0x0a, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0x50, 0x48,
|
||||
0x03, 0xd4, 0x20, 0xc2, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x1c, 0x92,
|
||||
0xe0, 0x38, 0x49, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
@@ -0,0 +1,690 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
//
|
||||
// GENERATED by DXC 1.9.2609 from wave64_emulation.hlsl by compile.sh; do not edit.
|
||||
|
||||
#if 0
|
||||
;
|
||||
; Note: shader requires additional functionality:
|
||||
; Wave level operations
|
||||
;
|
||||
;
|
||||
; Input signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; no parameters
|
||||
;
|
||||
; Output signature:
|
||||
;
|
||||
; Name Index Mask Register SysValue Format Used
|
||||
; -------------------- ----- ------ -------- -------- ------- ------
|
||||
; no parameters
|
||||
; shader hash: 3b5d2d89787d3b545fe7ad6022db2e55
|
||||
;
|
||||
; Pipeline Runtime Information:
|
||||
;
|
||||
;PSVRuntimeInfo:
|
||||
; Compute Shader
|
||||
; NumThreads=(64,1,1)
|
||||
; MinimumExpectedWaveLaneCount: 0
|
||||
; MaximumExpectedWaveLaneCount: 4294967295
|
||||
; UsesViewID: false
|
||||
; SigInputElements: 0
|
||||
; SigOutputElements: 0
|
||||
; SigPatchConstOrPrimElements: 0
|
||||
; SigInputVectors: 0
|
||||
; SigOutputVectors[0]: 0
|
||||
; SigOutputVectors[1]: 0
|
||||
; SigOutputVectors[2]: 0
|
||||
; SigOutputVectors[3]: 0
|
||||
; EntryFunctionName: main
|
||||
;
|
||||
;
|
||||
; Buffer Definitions:
|
||||
;
|
||||
; Resource bind info for Out
|
||||
; {
|
||||
;
|
||||
; uint $Element; ; Offset: 0 Size: 4
|
||||
;
|
||||
; }
|
||||
;
|
||||
;
|
||||
; Resource Bindings:
|
||||
;
|
||||
; Name Type Format Dim ID HLSL Bind Count
|
||||
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
|
||||
; Out UAV struct r/w U0 u0 1
|
||||
;
|
||||
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
|
||||
target triple = "dxil-ms-dx"
|
||||
|
||||
%dx.types.Handle = type { i8* }
|
||||
%dx.types.ResBind = type { i32, i32, i32, i8 }
|
||||
%dx.types.ResourceProperties = type { i32, i32 }
|
||||
%dx.types.fouri32 = type { i32, i32, i32, i32 }
|
||||
%"class.RWStructuredBuffer<unsigned int>" = type { i32 }
|
||||
|
||||
@"\01?g_pred@@3PAIA" = external addrspace(3) global [64 x i32], align 4
|
||||
@"\01?g_val@@3PAIA" = external addrspace(3) global [64 x i32], align 4
|
||||
@"\01?g_wave_ballot@@3PAIA" = external addrspace(3) global [64 x i32], align 4
|
||||
@"\01?g_wave_sum@@3PAIA" = external addrspace(3) global [64 x i32], align 4
|
||||
|
||||
define void @main() {
|
||||
%1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 1 }, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex)
|
||||
%2 = call i32 @dx.op.flattenedThreadIdInGroup.i32(i32 96) ; FlattenedThreadIdInGroup()
|
||||
%3 = mul i32 %2, 7
|
||||
%4 = add i32 %3, 3
|
||||
%5 = and i32 %4, 31
|
||||
%6 = mul i32 %2, 13
|
||||
%7 = add i32 %6, 5
|
||||
%8 = urem i32 %7, 3
|
||||
%9 = icmp eq i32 %8, 0
|
||||
%10 = zext i1 %9 to i32
|
||||
%11 = getelementptr [64 x i32], [64 x i32] addrspace(3)* @"\01?g_pred@@3PAIA", i32 0, i32 %2
|
||||
store i32 %10, i32 addrspace(3)* %11, align 4, !tbaa !11
|
||||
%12 = getelementptr [64 x i32], [64 x i32] addrspace(3)* @"\01?g_val@@3PAIA", i32 0, i32 %2
|
||||
store i32 %5, i32 addrspace(3)* %12, align 4, !tbaa !11
|
||||
call void @dx.op.barrier(i32 80, i32 9) ; Barrier(barrierMode)
|
||||
br label %33
|
||||
|
||||
; <label>:13 ; preds = %60
|
||||
%14 = shl i32 %2, 3
|
||||
%15 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %15, i32 %14, i32 0, i32 %52, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%16 = or i32 %14, 1
|
||||
%17 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %17, i32 %16, i32 0, i32 %51, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%18 = or i32 %14, 2
|
||||
%19 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %19, i32 %18, i32 0, i32 %62, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%20 = load i32, i32 addrspace(3)* getelementptr inbounds ([64 x i32], [64 x i32] addrspace(3)* @"\01?g_val@@3PAIA", i32 0, i32 37), align 4, !tbaa !11
|
||||
%21 = or i32 %14, 3
|
||||
%22 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %22, i32 %21, i32 0, i32 %20, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%23 = or i32 %14, 4
|
||||
%24 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %24, i32 %23, i32 0, i32 %63, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%25 = call i32 @dx.op.waveGetLaneCount(i32 112) ; WaveGetLaneCount()
|
||||
%26 = udiv i32 %2, %25
|
||||
%27 = call %dx.types.fouri32 @dx.op.waveActiveBallot(i32 116, i1 %9) ; WaveActiveBallot(cond)
|
||||
%28 = extractvalue %dx.types.fouri32 %27, 0
|
||||
%29 = extractvalue %dx.types.fouri32 %27, 1
|
||||
%30 = call i32 @dx.op.wavePrefixOp.i32(i32 121, i32 %5, i8 0, i8 1) ; WavePrefixOp(value,op,sop)
|
||||
%31 = call i32 @dx.op.waveActiveOp.i32(i32 119, i32 %5, i8 0, i8 1) ; WaveActiveOp(value,op,sop)
|
||||
%32 = call i1 @dx.op.waveIsFirstLane(i32 110) ; WaveIsFirstLane()
|
||||
br i1 %32, label %66, label %69
|
||||
|
||||
; <label>:33 ; preds = %60, %0
|
||||
%34 = phi i32 [ 0, %0 ], [ %63, %60 ]
|
||||
%35 = phi i32 [ 0, %0 ], [ %62, %60 ]
|
||||
%36 = phi i32 [ 0, %0 ], [ %51, %60 ]
|
||||
%37 = phi i32 [ 0, %0 ], [ %52, %60 ]
|
||||
%38 = phi i32 [ 0, %0 ], [ %64, %60 ]
|
||||
%39 = getelementptr [64 x i32], [64 x i32] addrspace(3)* @"\01?g_pred@@3PAIA", i32 0, i32 %38
|
||||
%40 = load i32, i32 addrspace(3)* %39, align 4, !tbaa !11
|
||||
%41 = icmp eq i32 %40, 0
|
||||
br i1 %41, label %50, label %42
|
||||
|
||||
; <label>:42 ; preds = %33
|
||||
%43 = icmp ult i32 %38, 32
|
||||
%44 = and i32 %38, 31
|
||||
%45 = shl i32 1, %44
|
||||
br i1 %43, label %46, label %48
|
||||
|
||||
; <label>:46 ; preds = %42
|
||||
%47 = or i32 %45, %37
|
||||
br label %50
|
||||
|
||||
; <label>:48 ; preds = %42
|
||||
%49 = or i32 %45, %36
|
||||
br label %50
|
||||
|
||||
; <label>:50 ; preds = %48, %46, %33
|
||||
%51 = phi i32 [ %36, %46 ], [ %49, %48 ], [ %36, %33 ]
|
||||
%52 = phi i32 [ %47, %46 ], [ %37, %48 ], [ %37, %33 ]
|
||||
%53 = icmp ult i32 %38, %2
|
||||
%54 = getelementptr [64 x i32], [64 x i32] addrspace(3)* @"\01?g_val@@3PAIA", i32 0, i32 %38
|
||||
br i1 %53, label %57, label %55
|
||||
|
||||
; <label>:55 ; preds = %50
|
||||
%56 = load i32, i32 addrspace(3)* %54, align 4, !tbaa !11
|
||||
br label %60
|
||||
|
||||
; <label>:57 ; preds = %50
|
||||
%58 = load i32, i32 addrspace(3)* %54, align 4, !tbaa !11
|
||||
%59 = add i32 %58, %35
|
||||
br label %60
|
||||
|
||||
; <label>:60 ; preds = %57, %55
|
||||
%61 = phi i32 [ %58, %57 ], [ %56, %55 ]
|
||||
%62 = phi i32 [ %59, %57 ], [ %35, %55 ]
|
||||
%63 = add i32 %61, %34
|
||||
%64 = add nuw nsw i32 %38, 1
|
||||
%65 = icmp eq i32 %64, 64
|
||||
br i1 %65, label %13, label %33
|
||||
|
||||
; <label>:66 ; preds = %13
|
||||
%67 = getelementptr [64 x i32], [64 x i32] addrspace(3)* @"\01?g_wave_ballot@@3PAIA", i32 0, i32 %26
|
||||
store i32 %28, i32 addrspace(3)* %67, align 4, !tbaa !11
|
||||
%68 = getelementptr [64 x i32], [64 x i32] addrspace(3)* @"\01?g_wave_sum@@3PAIA", i32 0, i32 %26
|
||||
store i32 %31, i32 addrspace(3)* %68, align 4, !tbaa !11
|
||||
br label %69
|
||||
|
||||
; <label>:69 ; preds = %66, %13
|
||||
call void @dx.op.barrier(i32 80, i32 9) ; Barrier(barrierMode)
|
||||
%70 = icmp eq i32 %26, 0
|
||||
br i1 %70, label %73, label %71
|
||||
|
||||
; <label>:71 ; preds = %69
|
||||
br label %76
|
||||
|
||||
; <label>:72 ; preds = %76
|
||||
br label %73
|
||||
|
||||
; <label>:73 ; preds = %72, %69
|
||||
%74 = phi i32 [ 0, %69 ], [ %81, %72 ]
|
||||
%75 = icmp eq i32 %25, 32
|
||||
br i1 %75, label %84, label %87
|
||||
|
||||
; <label>:76 ; preds = %76, %71
|
||||
%77 = phi i32 [ %81, %76 ], [ 0, %71 ]
|
||||
%78 = phi i32 [ %82, %76 ], [ 0, %71 ]
|
||||
%79 = getelementptr [64 x i32], [64 x i32] addrspace(3)* @"\01?g_wave_sum@@3PAIA", i32 0, i32 %78
|
||||
%80 = load i32, i32 addrspace(3)* %79, align 4, !tbaa !11
|
||||
%81 = add i32 %80, %77
|
||||
%82 = add nuw i32 %78, 1
|
||||
%83 = icmp ult i32 %82, %26
|
||||
br i1 %83, label %76, label %72
|
||||
|
||||
; <label>:84 ; preds = %73
|
||||
%85 = load i32, i32 addrspace(3)* getelementptr inbounds ([64 x i32], [64 x i32] addrspace(3)* @"\01?g_wave_ballot@@3PAIA", i32 0, i32 0), align 4, !tbaa !11
|
||||
%86 = load i32, i32 addrspace(3)* getelementptr inbounds ([64 x i32], [64 x i32] addrspace(3)* @"\01?g_wave_ballot@@3PAIA", i32 0, i32 1), align 4, !tbaa !11
|
||||
br label %91
|
||||
|
||||
; <label>:87 ; preds = %73
|
||||
%88 = icmp eq i32 %25, 64
|
||||
%89 = select i1 %88, i32 %28, i32 0
|
||||
%90 = select i1 %88, i32 %29, i32 0
|
||||
br label %91
|
||||
|
||||
; <label>:91 ; preds = %87, %84
|
||||
%92 = phi i32 [ %85, %84 ], [ %89, %87 ]
|
||||
%93 = phi i32 [ %86, %84 ], [ %90, %87 ]
|
||||
%94 = or i32 %14, 5
|
||||
%95 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %95, i32 %94, i32 0, i32 %92, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%96 = or i32 %14, 6
|
||||
%97 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %97, i32 %96, i32 0, i32 %93, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
%98 = add i32 %74, %30
|
||||
%99 = or i32 %14, 7
|
||||
%100 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4108, i32 4 }) ; AnnotateHandle(res,props) resource: RWStructuredBuffer<stride=4>
|
||||
call void @dx.op.rawBufferStore.i32(i32 140, %dx.types.Handle %100, i32 %99, i32 0, i32 %98, i32 undef, i32 undef, i32 undef, i8 1, i32 4) ; RawBufferStore(uav,index,elementOffset,value0,value1,value2,value3,mask,alignment)
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare i32 @dx.op.flattenedThreadIdInGroup.i32(i32) #0
|
||||
|
||||
; Function Attrs: noduplicate nounwind
|
||||
declare void @dx.op.barrier(i32, i32) #1
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare void @dx.op.rawBufferStore.i32(i32, %dx.types.Handle, i32, i32, i32, i32, i32, i32, i8, i32) #2
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare i32 @dx.op.waveGetLaneCount(i32) #0
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare %dx.types.fouri32 @dx.op.waveActiveBallot(i32, i1) #2
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare i32 @dx.op.waveActiveOp.i32(i32, i32, i8, i8) #2
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare i32 @dx.op.wavePrefixOp.i32(i32, i32, i8, i8) #2
|
||||
|
||||
; Function Attrs: nounwind
|
||||
declare i1 @dx.op.waveIsFirstLane(i32) #2
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #0
|
||||
|
||||
; Function Attrs: nounwind readnone
|
||||
declare %dx.types.Handle @dx.op.createHandleFromBinding(i32, %dx.types.ResBind, i32, i1) #0
|
||||
|
||||
attributes #0 = { nounwind readnone }
|
||||
attributes #1 = { noduplicate nounwind }
|
||||
attributes #2 = { nounwind }
|
||||
|
||||
!llvm.ident = !{!0}
|
||||
!dx.version = !{!1}
|
||||
!dx.valver = !{!2}
|
||||
!dx.shaderModel = !{!3}
|
||||
!dx.resources = !{!4}
|
||||
!dx.entryPoints = !{!8}
|
||||
|
||||
!0 = !{!"dxcoob 1.9.2609.5 (01b62ad47)"}
|
||||
!1 = !{i32 1, i32 6}
|
||||
!2 = !{i32 1, i32 9}
|
||||
!3 = !{!"cs", i32 6, i32 6}
|
||||
!4 = !{null, !5, null, null}
|
||||
!5 = !{!6}
|
||||
!6 = !{i32 0, %"class.RWStructuredBuffer<unsigned int>"* undef, !"", i32 0, i32 0, i32 1, i32 12, i1 false, i1 false, i1 false, !7}
|
||||
!7 = !{i32 1, i32 4}
|
||||
!8 = !{void ()* @main, !"main", null, !4, !9}
|
||||
!9 = !{i32 0, i64 524304, i32 4, !10}
|
||||
!10 = !{i32 64, i32 1, i32 1}
|
||||
!11 = !{!12, !12, i64 0}
|
||||
!12 = !{!"int", !13, i64 0}
|
||||
!13 = !{!"omnipotent char", !14, i64 0}
|
||||
!14 = !{!"Simple C/C++ TBAA"}
|
||||
|
||||
#endif
|
||||
|
||||
const unsigned char g_wave64_emulation_cs[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x9b, 0xbd, 0xc8, 0xad, 0x5a, 0x85, 0x09, 0xde,
|
||||
0x94, 0xc7, 0x79, 0x0b, 0x29, 0x89, 0xdb, 0xc6, 0x01, 0x00, 0x00, 0x00,
|
||||
0xe0, 0x12, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x4c, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
|
||||
0xdc, 0x00, 0x00, 0x00, 0x4c, 0x08, 0x00, 0x00, 0x68, 0x08, 0x00, 0x00,
|
||||
0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x53, 0x47, 0x31,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x50, 0x53, 0x56, 0x30, 0x68, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0x68, 0x07, 0x00, 0x00,
|
||||
0x66, 0x00, 0x05, 0x00, 0xda, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x50, 0x07, 0x00, 0x00,
|
||||
0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00,
|
||||
0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
|
||||
0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
|
||||
0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, 0x14,
|
||||
0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20,
|
||||
0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
|
||||
0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
|
||||
0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d,
|
||||
0x86, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0xc0, 0x00, 0xd2, 0x06, 0x62,
|
||||
0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0x90, 0x00, 0x49, 0x18, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
|
||||
0x32, 0x22, 0x88, 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84,
|
||||
0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8c, 0x8c,
|
||||
0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x84, 0xc1, 0x1c, 0x01, 0x18, 0x24, 0x10,
|
||||
0x30, 0x88, 0x10, 0x0c, 0x23, 0x00, 0x25, 0x18, 0x88, 0x28, 0x02, 0x00,
|
||||
0x90, 0x51, 0x86, 0x01, 0x00, 0x08, 0x99, 0x23, 0x40, 0x48, 0xb9, 0x67,
|
||||
0xb8, 0xfc, 0x09, 0x7b, 0x08, 0xc9, 0x0f, 0x81, 0x66, 0x58, 0x08, 0x14,
|
||||
0x2c, 0x65, 0x19, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x14, 0x80, 0x9a,
|
||||
0x83, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0xc2, 0xa1, 0x22, 0xe4,
|
||||
0xb6, 0x11, 0x01, 0x00, 0x00, 0x30, 0x47, 0x10, 0x94, 0xe1, 0x01, 0x20,
|
||||
0x8a, 0x4a, 0x01, 0x00, 0x80, 0xa2, 0xd0, 0x54, 0x04, 0x08, 0xa0, 0xea,
|
||||
0xb6, 0xe1, 0xf2, 0x27, 0xec, 0x21, 0x24, 0x7f, 0x25, 0x24, 0x87, 0x8a,
|
||||
0x04, 0x22, 0x8d, 0x9c, 0x87, 0x88, 0x26, 0x84, 0x90, 0x90, 0x00, 0x00,
|
||||
0x85, 0x60, 0x00, 0xe6, 0x22, 0xec, 0xa0, 0xe1, 0xf2, 0x27, 0xec, 0x21,
|
||||
0x24, 0x7f, 0x25, 0xa4, 0x0d, 0x69, 0x06, 0x44, 0x00, 0x00, 0xa0, 0x94,
|
||||
0x82, 0x01, 0x34, 0x00, 0xa2, 0x6d, 0x20, 0x60, 0x26, 0x33, 0x18, 0x07,
|
||||
0x76, 0x08, 0x87, 0x79, 0x98, 0x07, 0x37, 0x90, 0x85, 0x5b, 0x98, 0x05,
|
||||
0x7a, 0x90, 0x87, 0x7a, 0x18, 0x07, 0x7a, 0xa8, 0x07, 0x79, 0x28, 0x07,
|
||||
0x72, 0x10, 0x85, 0x7a, 0x30, 0x07, 0x73, 0x28, 0x07, 0x79, 0xe0, 0x83,
|
||||
0x7a, 0x70, 0x87, 0x79, 0x48, 0x87, 0x73, 0x70, 0x87, 0x72, 0x20, 0x07,
|
||||
0x30, 0x48, 0x07, 0x77, 0xa0, 0x07, 0x3f, 0x40, 0x01, 0x40, 0xde, 0x1c,
|
||||
0x01, 0x28, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
|
||||
0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
|
||||
0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
|
||||
0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
|
||||
0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
|
||||
0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
|
||||
0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
|
||||
0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
|
||||
0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
|
||||
0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
|
||||
0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x3a, 0x0f,
|
||||
0x24, 0x90, 0x21, 0x23, 0x45, 0x44, 0x00, 0x76, 0x00, 0x30, 0x3b, 0x00,
|
||||
0x98, 0x1d, 0x00, 0xcc, 0x0e, 0x00, 0x1e, 0xf2, 0x10, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, 0x31, 0x80, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xc8, 0x83, 0x00,
|
||||
0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0xa7,
|
||||
0x01, 0x02, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21,
|
||||
0x8f, 0x01, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x43, 0x9e, 0x08, 0x08, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x86, 0x3c, 0x13, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0c, 0x79, 0x26, 0x20, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x18, 0xf2, 0x54, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x30, 0xe4, 0xc1, 0x80, 0x00, 0x08, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xc8, 0xb3, 0x01, 0x01, 0x10, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x16, 0x08, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x18, 0x19, 0x11, 0x4c, 0x90,
|
||||
0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x02, 0x4a, 0xa0, 0x18, 0x46,
|
||||
0x00, 0x0a, 0xa3, 0x10, 0xca, 0xa0, 0x1c, 0x4a, 0x61, 0x06, 0xa0, 0x00,
|
||||
0x03, 0x0a, 0x10, 0xa2, 0x2c, 0x8a, 0xa0, 0x20, 0xca, 0x3c, 0xa0, 0x4c,
|
||||
0x0a, 0x84, 0xa0, 0x11, 0x00, 0x02, 0x0b, 0x14, 0x10, 0x88, 0xbe, 0x19,
|
||||
0x00, 0xf2, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x73, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4,
|
||||
0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45,
|
||||
0xc6, 0x06, 0x26, 0xc7, 0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46,
|
||||
0x26, 0x8c, 0x8c, 0xe6, 0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x80, 0x67,
|
||||
0x82, 0x00, 0x40, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x00, 0xd1, 0x06, 0xc1,
|
||||
0x30, 0x28, 0x8c, 0xcd, 0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x7c, 0x62,
|
||||
0xc0, 0xe1, 0xa9, 0x8e, 0x6e, 0x82, 0x00, 0x48, 0x13, 0x04, 0x08, 0x0c,
|
||||
0x26, 0x08, 0xc0, 0xb4, 0x41, 0x18, 0x9c, 0x0d, 0x8b, 0xa1, 0x2c, 0x86,
|
||||
0x31, 0x30, 0x4d, 0xd3, 0x3c, 0x1b, 0x02, 0x68, 0x03, 0x01, 0x44, 0x00,
|
||||
0x30, 0x41, 0xf0, 0xc6, 0x80, 0x01, 0xda, 0x04, 0x01, 0xa0, 0x26, 0x08,
|
||||
0x40, 0x35, 0x41, 0x00, 0xac, 0x0d, 0x06, 0x41, 0x55, 0x86, 0x75, 0x4d,
|
||||
0x10, 0x80, 0x6b, 0x83, 0x60, 0x64, 0x1b, 0x02, 0x6d, 0x83, 0x60, 0x6c,
|
||||
0x1b, 0x06, 0x07, 0xe3, 0x36, 0x0c, 0xc6, 0xd4, 0x4d, 0x10, 0x0a, 0x62,
|
||||
0x03, 0xb0, 0x61, 0x30, 0xc0, 0x00, 0x0c, 0x36, 0x04, 0x61, 0xb0, 0x61,
|
||||
0x18, 0x3e, 0x31, 0x20, 0xd1, 0x16, 0x96, 0xe6, 0x36, 0x41, 0x00, 0x83,
|
||||
0x30, 0x98, 0x20, 0x00, 0xd8, 0x86, 0xc1, 0x0c, 0x86, 0x61, 0x03, 0x61,
|
||||
0x94, 0x81, 0x73, 0x06, 0x1b, 0x8a, 0x8f, 0x0c, 0x00, 0x09, 0x0d, 0x08,
|
||||
0x85, 0xc9, 0xc9, 0x85, 0xe5, 0x7d, 0xd1, 0x9d, 0xcd, 0xb5, 0x7d, 0x89,
|
||||
0xe5, 0xd1, 0x95, 0xcd, 0x4d, 0x10, 0x80, 0x8c, 0x4f, 0x98, 0x9c, 0x5c,
|
||||
0x58, 0xde, 0x17, 0xdd, 0xd9, 0x5c, 0xdb, 0x17, 0x1b, 0xd9, 0x1c, 0xdd,
|
||||
0x04, 0x01, 0xd0, 0x78, 0x88, 0x85, 0xc9, 0xc9, 0xa5, 0x95, 0xc9, 0x4d,
|
||||
0x10, 0x80, 0x8d, 0x88, 0x98, 0x5c, 0x98, 0xdb, 0x18, 0x5a, 0xd9, 0xdc,
|
||||
0x04, 0x01, 0xe0, 0x58, 0xa4, 0xb9, 0xcd, 0xd1, 0xcd, 0x4d, 0x10, 0x80,
|
||||
0x8e, 0x44, 0x9a, 0x1b, 0xdd, 0xdc, 0x04, 0x01, 0xf0, 0x98, 0xd0, 0x95,
|
||||
0xe1, 0x7d, 0xcd, 0xd1, 0xbd, 0xc9, 0x95, 0xb1, 0xa8, 0x4b, 0x73, 0xa3,
|
||||
0x9b, 0x9b, 0x20, 0x00, 0xdf, 0x06, 0x48, 0x0d, 0xd6, 0x80, 0x0d, 0xda,
|
||||
0xc0, 0x0d, 0xde, 0x00, 0x0e, 0xe2, 0x40, 0x0e, 0xe6, 0x80, 0x0e, 0xea,
|
||||
0xc0, 0x0e, 0xe2, 0xe0, 0x0e, 0xf0, 0xa0, 0x0a, 0x1b, 0x9b, 0x5d, 0x9b,
|
||||
0x4b, 0x1a, 0x59, 0x99, 0x1b, 0xdd, 0x94, 0x20, 0xa8, 0x42, 0x86, 0xe7,
|
||||
0x62, 0x57, 0x26, 0x37, 0x97, 0xf6, 0xe6, 0x36, 0x25, 0x20, 0x9a, 0x90,
|
||||
0xe1, 0xb9, 0xd8, 0x85, 0xb1, 0xd9, 0x95, 0xc9, 0x4d, 0x09, 0x8c, 0x3a,
|
||||
0x64, 0x78, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x6f, 0x64,
|
||||
0x65, 0x6c, 0x53, 0x02, 0xa4, 0x0c, 0x19, 0x9e, 0x8b, 0x5c, 0xd9, 0xdc,
|
||||
0x5b, 0x9d, 0xdc, 0x58, 0xd9, 0xdc, 0x94, 0x20, 0xaa, 0x44, 0x86, 0xe7,
|
||||
0x42, 0x97, 0x07, 0x57, 0x16, 0xe4, 0xe6, 0xf6, 0x46, 0x17, 0x46, 0x97,
|
||||
0xf6, 0xe6, 0x36, 0x37, 0x45, 0xe8, 0xc4, 0xa0, 0x0e, 0x19, 0x9e, 0x4b,
|
||||
0x99, 0x1b, 0x9d, 0x5c, 0x1e, 0xd4, 0x5b, 0x9a, 0x1b, 0xdd, 0xdc, 0x94,
|
||||
0x00, 0x0d, 0xba, 0x90, 0xe1, 0xb9, 0x8c, 0xbd, 0xd5, 0xb9, 0xd1, 0x95,
|
||||
0xc9, 0xcd, 0x4d, 0x09, 0xf0, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x51, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
|
||||
0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
|
||||
0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
|
||||
0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
|
||||
0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
|
||||
0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
|
||||
0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
|
||||
0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
|
||||
0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
|
||||
0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
|
||||
0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
|
||||
0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
|
||||
0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
|
||||
0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
|
||||
0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
|
||||
0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
|
||||
0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
|
||||
0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
|
||||
0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
|
||||
0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
|
||||
0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
|
||||
0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
|
||||
0xb0, 0xc3, 0x0c, 0xc4, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87,
|
||||
0x76, 0x80, 0x87, 0x19, 0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20,
|
||||
0x0e, 0xe7, 0xe0, 0x06, 0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90,
|
||||
0x0f, 0xef, 0x50, 0x0f, 0xf4, 0x30, 0x83, 0x81, 0xc8, 0x01, 0x1f, 0xdc,
|
||||
0x40, 0x1c, 0xe4, 0xa1, 0x1c, 0xc2, 0x61, 0x1d, 0xdc, 0x40, 0x1c, 0xe4,
|
||||
0x01, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00,
|
||||
0x05, 0xf0, 0x04, 0x7e, 0xe7, 0x2f, 0x5c, 0x5e, 0x26, 0x03, 0x81, 0x33,
|
||||
0x68, 0x30, 0x19, 0xac, 0x00, 0x27, 0xf0, 0x3b, 0x7f, 0xed, 0x61, 0x36,
|
||||
0x10, 0x38, 0x83, 0x06, 0x93, 0xc1, 0x12, 0xb0, 0x02, 0xbf, 0xf3, 0xf7,
|
||||
0x1e, 0xb6, 0x97, 0xbf, 0xe2, 0x30, 0x9b, 0xfd, 0xa6, 0x03, 0x81, 0x33,
|
||||
0x68, 0x30, 0x19, 0xac, 0x81, 0x29, 0xf0, 0x3b, 0x7f, 0xef, 0x61, 0x7b,
|
||||
0xf9, 0x3b, 0xaf, 0xb7, 0x81, 0xc0, 0x19, 0x34, 0x98, 0x0c, 0x5a, 0x03,
|
||||
0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0x40, 0xd3, 0x38, 0x13, 0x30, 0x11, 0x21,
|
||||
0xd0, 0x0c, 0x0b, 0x61, 0x06, 0xcd, 0x70, 0xf9, 0xce, 0xe3, 0x07, 0x40,
|
||||
0x14, 0x21, 0x44, 0x64, 0x0e, 0xdd, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x11,
|
||||
0x01, 0x4c, 0x44, 0x08, 0x34, 0xc3, 0x42, 0x7c, 0x91, 0xc3, 0x6c, 0x48,
|
||||
0x33, 0x20, 0x8d, 0x61, 0x05, 0x62, 0x30, 0x5c, 0xbe, 0xf3, 0xf8, 0xc5,
|
||||
0x02, 0x4c, 0x13, 0xd1, 0x10, 0x43, 0x7b, 0x44, 0x04, 0x30, 0x88, 0x83,
|
||||
0xd8, 0x80, 0x91, 0x43, 0x3d, 0x3e, 0x72, 0xdb, 0x76, 0x80, 0x0d, 0x97,
|
||||
0xef, 0x3c, 0x7e, 0x04, 0x58, 0x1b, 0x55, 0x14, 0x44, 0xc4, 0x4e, 0x4e,
|
||||
0x44, 0xf8, 0xc8, 0x6d, 0x5b, 0x82, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0x16,
|
||||
0x50, 0x11, 0x9a, 0x30, 0x21, 0x15, 0xb1, 0x01, 0xcb, 0xe2, 0x4c, 0xa6,
|
||||
0x60, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x05, 0x54, 0x84, 0x26, 0x4c, 0x48,
|
||||
0x45, 0xa0, 0x8f, 0x8f, 0xdc, 0xb6, 0x21, 0x58, 0xc3, 0xe5, 0x3b, 0x8f,
|
||||
0x6f, 0x01, 0x15, 0x01, 0x12, 0x53, 0x09, 0x34, 0x04, 0xe7, 0x50, 0xcd,
|
||||
0x64, 0x0c, 0xd5, 0x70, 0xf9, 0xce, 0xe3, 0x5b, 0x40, 0x45, 0x88, 0xd2,
|
||||
0x87, 0x44, 0xd2, 0x54, 0x02, 0x0d, 0x61, 0x0b, 0xd6, 0x70, 0xf9, 0xce,
|
||||
0xe3, 0x5b, 0x40, 0x45, 0xa4, 0x11, 0x51, 0x20, 0x17, 0xfa, 0xf8, 0xc8,
|
||||
0x6d, 0x1b, 0x01, 0xc1, 0x00, 0x48, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x5d, 0x2d, 0x89, 0x78, 0x7d, 0x3b, 0x54, 0x5f, 0xe7, 0xad, 0x60,
|
||||
0x22, 0xdb, 0x2e, 0x55, 0x44, 0x58, 0x49, 0x4c, 0x70, 0x0a, 0x00, 0x00,
|
||||
0x66, 0x00, 0x05, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
|
||||
0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x58, 0x0a, 0x00, 0x00,
|
||||
0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x93, 0x02, 0x00, 0x00,
|
||||
0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
|
||||
0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
|
||||
0x80, 0x18, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xc4, 0x10, 0x32, 0x14,
|
||||
0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x62, 0x88, 0x48, 0x90, 0x14, 0x20,
|
||||
0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
|
||||
0x11, 0x23, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
|
||||
0x04, 0x31, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xa8, 0x0d,
|
||||
0x86, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0xc0, 0x00, 0xd2, 0x06, 0x62,
|
||||
0xf8, 0xff, 0xff, 0xff, 0xff, 0x01, 0x90, 0x00, 0x49, 0x18, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
|
||||
0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
|
||||
0x32, 0x22, 0x88, 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x23, 0xa4, 0x84,
|
||||
0x04, 0x13, 0x23, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8c, 0x8c,
|
||||
0x0b, 0x84, 0xc4, 0x4c, 0x10, 0x8c, 0xc1, 0x1c, 0x01, 0x18, 0x24, 0x10,
|
||||
0x30, 0x88, 0x10, 0x0c, 0x23, 0x00, 0x25, 0x18, 0x88, 0x28, 0x02, 0x00,
|
||||
0x90, 0x51, 0x86, 0x01, 0x00, 0x08, 0x99, 0x23, 0x40, 0x48, 0xb9, 0x67,
|
||||
0xb8, 0xfc, 0x09, 0x7b, 0x08, 0xc9, 0x0f, 0x81, 0x66, 0x58, 0x08, 0x14,
|
||||
0x2c, 0x65, 0x19, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x14, 0x80, 0x9a,
|
||||
0x83, 0x86, 0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0xc2, 0xa1, 0x22, 0xe4,
|
||||
0xb6, 0x11, 0x01, 0x00, 0x00, 0x30, 0x47, 0x10, 0x94, 0xe1, 0x01, 0x20,
|
||||
0x8a, 0x4a, 0x01, 0x00, 0x80, 0xa2, 0xd0, 0x54, 0x04, 0x08, 0xa0, 0xea,
|
||||
0xb6, 0xe1, 0xf2, 0x27, 0xec, 0x21, 0x24, 0x7f, 0x25, 0x24, 0x87, 0x8a,
|
||||
0x04, 0x22, 0x8d, 0x9c, 0x87, 0x88, 0x26, 0x84, 0x90, 0x90, 0x00, 0x00,
|
||||
0x85, 0x60, 0x00, 0xe6, 0x22, 0xec, 0xa0, 0xe1, 0xf2, 0x27, 0xec, 0x21,
|
||||
0x24, 0x7f, 0x25, 0xa4, 0x0d, 0x69, 0x06, 0x44, 0x00, 0x00, 0xa0, 0x94,
|
||||
0x82, 0x01, 0x34, 0x00, 0xa2, 0x6d, 0x20, 0x60, 0x26, 0x33, 0x18, 0x07,
|
||||
0x76, 0x08, 0x87, 0x79, 0x98, 0x07, 0x37, 0x90, 0x85, 0x5b, 0x98, 0x05,
|
||||
0x7a, 0x90, 0x87, 0x7a, 0x18, 0x07, 0x7a, 0xa8, 0x07, 0x79, 0x28, 0x07,
|
||||
0x72, 0x10, 0x85, 0x7a, 0x30, 0x07, 0x73, 0x28, 0x07, 0x79, 0xe0, 0x83,
|
||||
0x7a, 0x70, 0x87, 0x79, 0x48, 0x87, 0x73, 0x70, 0x87, 0x72, 0x20, 0x07,
|
||||
0x30, 0x48, 0x07, 0x77, 0xa0, 0x07, 0x3f, 0x40, 0x01, 0x40, 0xde, 0x1c,
|
||||
0x01, 0x28, 0x0c, 0x22, 0x00, 0xc3, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79,
|
||||
0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
|
||||
0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07,
|
||||
0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e,
|
||||
0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07,
|
||||
0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07,
|
||||
0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
|
||||
0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07,
|
||||
0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x3a, 0x0f, 0x24, 0x90, 0x21, 0x23,
|
||||
0x45, 0x44, 0x00, 0x76, 0x00, 0x30, 0x3b, 0x00, 0x98, 0x1d, 0x00, 0xcc,
|
||||
0x0e, 0x00, 0x1e, 0xf2, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x30, 0xe4, 0x31, 0x80, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x60, 0xc8, 0x83, 0x00, 0x01, 0x20, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0xa7, 0x01, 0x02, 0x60, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x8f, 0x01, 0x04, 0x40,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x9e, 0x08, 0x08,
|
||||
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x3c, 0x13,
|
||||
0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79,
|
||||
0x26, 0x20, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||
0xf2, 0x54, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x30, 0xe4, 0xc1, 0x80, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x60, 0xc8, 0xb3, 0x01, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0x16, 0x08, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47,
|
||||
0xc6, 0x04, 0x43, 0x02, 0x4a, 0xa0, 0x18, 0x4a, 0x62, 0x04, 0xa0, 0x30,
|
||||
0x0a, 0xa1, 0x00, 0x03, 0x08, 0x1a, 0x01, 0x20, 0x70, 0x04, 0xa0, 0x40,
|
||||
0x01, 0x81, 0xe8, 0x9b, 0x01, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4,
|
||||
0x8e, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x25, 0xc7, 0x45,
|
||||
0xc6, 0x06, 0x26, 0xc7, 0xa5, 0x06, 0x04, 0x05, 0x26, 0x46, 0xcc, 0x46,
|
||||
0x26, 0x8c, 0x8c, 0xe6, 0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x80, 0x67,
|
||||
0x82, 0x00, 0x40, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x00, 0xd1, 0x06, 0x61,
|
||||
0x30, 0x28, 0x8c, 0xcd, 0x6d, 0x18, 0x10, 0x82, 0x98, 0x20, 0x00, 0xd2,
|
||||
0x04, 0xe1, 0xcb, 0x08, 0x4c, 0x10, 0x80, 0x69, 0x82, 0x00, 0x59, 0x13,
|
||||
0x04, 0x80, 0xda, 0x20, 0x0c, 0xcf, 0x86, 0x45, 0x59, 0x18, 0x45, 0x19,
|
||||
0x1a, 0xc7, 0x71, 0xa0, 0x0d, 0x41, 0xb4, 0x81, 0x00, 0x24, 0x00, 0x98,
|
||||
0x20, 0x14, 0x04, 0x89, 0xb6, 0xb0, 0x34, 0xb7, 0x09, 0x02, 0x18, 0x60,
|
||||
0x13, 0x04, 0xa0, 0xda, 0x30, 0x5c, 0xc3, 0xb0, 0x81, 0x50, 0xac, 0x07,
|
||||
0xdb, 0x50, 0x50, 0x15, 0x30, 0x65, 0x1c, 0xd2, 0xdc, 0xe8, 0xf8, 0xbc,
|
||||
0xb5, 0xb9, 0xa5, 0xc1, 0xbd, 0xd1, 0x95, 0xb9, 0xd1, 0x81, 0x8c, 0xa1,
|
||||
0x85, 0xc9, 0x31, 0x9a, 0x4a, 0x6b, 0x83, 0x63, 0x2b, 0x03, 0x19, 0x7a,
|
||||
0x19, 0x5a, 0x59, 0x01, 0xa1, 0x12, 0x0a, 0x0a, 0xda, 0x10, 0x74, 0x13,
|
||||
0x04, 0x30, 0xb8, 0x36, 0x0c, 0x9c, 0xf7, 0x6d, 0x18, 0x36, 0x30, 0xf8,
|
||||
0x36, 0x0c, 0x61, 0x10, 0x06, 0x5f, 0x15, 0x36, 0x36, 0xbb, 0x36, 0x97,
|
||||
0x34, 0xb2, 0x32, 0x37, 0xba, 0x29, 0x41, 0x50, 0x85, 0x0c, 0xcf, 0xc5,
|
||||
0xae, 0x4c, 0x6e, 0x2e, 0xed, 0xcd, 0x6d, 0x4a, 0x40, 0x34, 0x21, 0xc3,
|
||||
0x73, 0xb1, 0x0b, 0x63, 0xb3, 0x2b, 0x93, 0x9b, 0x12, 0x18, 0x75, 0xc8,
|
||||
0xf0, 0x5c, 0xe6, 0xd0, 0xc2, 0xc8, 0xca, 0xe4, 0x9a, 0xde, 0xc8, 0xca,
|
||||
0xd8, 0xa6, 0x04, 0x48, 0x19, 0x32, 0x3c, 0x17, 0xb9, 0xb2, 0xb9, 0xb7,
|
||||
0x3a, 0xb9, 0xb1, 0xb2, 0xb9, 0x29, 0x81, 0x54, 0x87, 0x0c, 0xcf, 0xa5,
|
||||
0xcc, 0x8d, 0x4e, 0x2e, 0x0f, 0xea, 0x2d, 0xcd, 0x8d, 0x6e, 0x6e, 0x4a,
|
||||
0x90, 0x01, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
|
||||
0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
|
||||
0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
|
||||
0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
|
||||
0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
|
||||
0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
|
||||
0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
|
||||
0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
|
||||
0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
|
||||
0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
|
||||
0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
|
||||
0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
|
||||
0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
|
||||
0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
|
||||
0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
|
||||
0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
|
||||
0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
|
||||
0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
|
||||
0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
|
||||
0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
|
||||
0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
|
||||
0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
|
||||
0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x0c, 0xc4,
|
||||
0x21, 0x07, 0x7c, 0x70, 0x03, 0x7a, 0x28, 0x87, 0x76, 0x80, 0x87, 0x19,
|
||||
0xd1, 0x43, 0x0e, 0xf8, 0xe0, 0x06, 0xe4, 0x20, 0x0e, 0xe7, 0xe0, 0x06,
|
||||
0xf6, 0x10, 0x0e, 0xf2, 0xc0, 0x0e, 0xe1, 0x90, 0x0f, 0xef, 0x50, 0x0f,
|
||||
0xf4, 0x30, 0x83, 0x81, 0xc8, 0x01, 0x1f, 0xdc, 0x40, 0x1c, 0xe4, 0xa1,
|
||||
0x1c, 0xc2, 0x61, 0x1d, 0xdc, 0x40, 0x1c, 0xe4, 0x01, 0x00, 0x00, 0x00,
|
||||
0x71, 0x20, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x05, 0xf0, 0x04, 0x7e,
|
||||
0xe7, 0x2f, 0x5c, 0x5e, 0x26, 0x03, 0x81, 0x33, 0x68, 0x30, 0x19, 0xac,
|
||||
0x00, 0x27, 0xf0, 0x3b, 0x7f, 0xed, 0x61, 0x36, 0x10, 0x38, 0x83, 0x06,
|
||||
0x93, 0xc1, 0x12, 0xb0, 0x02, 0xbf, 0xf3, 0xf7, 0x1e, 0xb6, 0x97, 0xbf,
|
||||
0xe2, 0x30, 0x9b, 0xfd, 0xa6, 0x03, 0x81, 0x33, 0x68, 0x30, 0x19, 0xac,
|
||||
0x81, 0x29, 0xf0, 0x3b, 0x7f, 0xef, 0x61, 0x7b, 0xf9, 0x3b, 0xaf, 0xb7,
|
||||
0x81, 0xc0, 0x19, 0x34, 0x98, 0x0c, 0x5a, 0x03, 0x35, 0x5c, 0xbe, 0xf3,
|
||||
0xf8, 0x40, 0xd3, 0x38, 0x13, 0x30, 0x11, 0x21, 0xd0, 0x0c, 0x0b, 0x61,
|
||||
0x06, 0xcd, 0x70, 0xf9, 0xce, 0xe3, 0x07, 0x40, 0x14, 0x21, 0x44, 0x64,
|
||||
0x0e, 0xdd, 0x70, 0xf9, 0xce, 0xe3, 0x0b, 0x11, 0x01, 0x4c, 0x44, 0x08,
|
||||
0x34, 0xc3, 0x42, 0x7c, 0x91, 0xc3, 0x6c, 0x48, 0x33, 0x20, 0x8d, 0x61,
|
||||
0x05, 0x62, 0x30, 0x5c, 0xbe, 0xf3, 0xf8, 0xc5, 0x02, 0x4c, 0x13, 0xd1,
|
||||
0x10, 0x43, 0x7b, 0x44, 0x04, 0x30, 0x88, 0x83, 0xd8, 0x80, 0x91, 0x43,
|
||||
0x3d, 0x3e, 0x72, 0xdb, 0x76, 0x80, 0x0d, 0x97, 0xef, 0x3c, 0x7e, 0x04,
|
||||
0x58, 0x1b, 0x55, 0x14, 0x44, 0xc4, 0x4e, 0x4e, 0x44, 0xf8, 0xc8, 0x6d,
|
||||
0x5b, 0x82, 0x35, 0x5c, 0xbe, 0xf3, 0xf8, 0x16, 0x50, 0x11, 0x9a, 0x30,
|
||||
0x21, 0x15, 0xb1, 0x01, 0xcb, 0xe2, 0x4c, 0xa6, 0x60, 0x0d, 0x97, 0xef,
|
||||
0x3c, 0xbe, 0x05, 0x54, 0x84, 0x26, 0x4c, 0x48, 0x45, 0xa0, 0x8f, 0x8f,
|
||||
0xdc, 0xb6, 0x21, 0x58, 0xc3, 0xe5, 0x3b, 0x8f, 0x6f, 0x01, 0x15, 0x01,
|
||||
0x12, 0x53, 0x09, 0x34, 0x04, 0xe7, 0x50, 0xcd, 0x64, 0x0c, 0xd5, 0x70,
|
||||
0xf9, 0xce, 0xe3, 0x5b, 0x40, 0x45, 0x88, 0xd2, 0x87, 0x44, 0xd2, 0x54,
|
||||
0x02, 0x0d, 0x61, 0x0b, 0xd6, 0x70, 0xf9, 0xce, 0xe3, 0x5b, 0x40, 0x45,
|
||||
0xa4, 0x11, 0x51, 0x20, 0x17, 0xfa, 0xf8, 0xc8, 0x6d, 0x1b, 0x01, 0xc1,
|
||||
0x00, 0x48, 0x03, 0x00, 0x61, 0x20, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00,
|
||||
0x13, 0x04, 0x53, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
|
||||
0x04, 0xcc, 0x00, 0x14, 0xec, 0x40, 0x61, 0x0a, 0x94, 0x41, 0x39, 0x94,
|
||||
0x4f, 0x29, 0x14, 0x68, 0x40, 0x01, 0x95, 0xec, 0x40, 0x01, 0x07, 0x94,
|
||||
0x46, 0x61, 0x02, 0x15, 0x41, 0x29, 0x15, 0x78, 0x40, 0xa1, 0x07, 0x94,
|
||||
0x7c, 0x40, 0xb9, 0x07, 0x14, 0x77, 0x00, 0x29, 0x25, 0x30, 0x02, 0x40,
|
||||
0xd7, 0x1c, 0x82, 0x19, 0x50, 0xa4, 0xcd, 0x41, 0x48, 0x92, 0xe4, 0x06,
|
||||
0x14, 0x0e, 0x75, 0x04, 0x42, 0x00, 0x48, 0x00, 0x1a, 0x0c, 0x75, 0x04,
|
||||
0x82, 0x00, 0x48, 0x80, 0x34, 0xd4, 0x11, 0x08, 0x02, 0x20, 0x01, 0x0f,
|
||||
0x00, 0x00, 0x00, 0x00, 0x23, 0x06, 0x08, 0x00, 0x82, 0x60, 0xb0, 0x9d,
|
||||
0x81, 0x44, 0x8c, 0xc1, 0x37, 0x62, 0x50, 0x00, 0x20, 0x08, 0x06, 0x46,
|
||||
0x1c, 0x48, 0x15, 0x64, 0x52, 0xc1, 0x06, 0x15, 0x68, 0x5a, 0x44, 0x25,
|
||||
0x15, 0x6c, 0x50, 0xc1, 0x57, 0xc3, 0x0d, 0xc1, 0x1a, 0x80, 0xc1, 0x05,
|
||||
0x40, 0xac, 0x60, 0xf8, 0x83, 0x36, 0x48, 0x86, 0x0d, 0x88, 0x40, 0x18,
|
||||
0x80, 0x15, 0x0c, 0x7f, 0xe0, 0x06, 0xca, 0xb0, 0x01, 0x11, 0x20, 0x03,
|
||||
0x30, 0x62, 0x60, 0x00, 0x20, 0x08, 0x06, 0xc8, 0x1e, 0x80, 0x01, 0x1c,
|
||||
0xcc, 0x12, 0x08, 0xb5, 0x90, 0xc1, 0x8d, 0x18, 0x1c, 0x00, 0x08, 0x82,
|
||||
0x01, 0x56, 0x07, 0x67, 0xd0, 0x48, 0x23, 0x06, 0x0e, 0x00, 0x82, 0x60,
|
||||
0xd0, 0xf0, 0xc1, 0x19, 0x04, 0x42, 0x1c, 0x84, 0xff, 0xff, 0xff, 0xff,
|
||||
0x90, 0x06, 0x69, 0x90, 0x06, 0xd5, 0x1b, 0x94, 0x40, 0x07, 0x3b, 0x62,
|
||||
0x70, 0x00, 0x20, 0x08, 0x06, 0xd8, 0x1d, 0xa4, 0xc1, 0x43, 0x8d, 0x18,
|
||||
0x38, 0x00, 0x08, 0x82, 0x41, 0xe3, 0x07, 0x69, 0x10, 0x08, 0x73, 0x40,
|
||||
0xfe, 0xff, 0xff, 0xff, 0xc3, 0x1a, 0xac, 0xc1, 0x1a, 0x5c, 0x71, 0x50,
|
||||
0x84, 0xb7, 0x23, 0x06, 0x07, 0x00, 0x82, 0x60, 0x80, 0xe5, 0xc1, 0x1a,
|
||||
0x44, 0xd6, 0x88, 0x81, 0x03, 0x80, 0x20, 0x18, 0x34, 0xa0, 0xb0, 0x06,
|
||||
0x81, 0x50, 0x07, 0xbe, 0xff, 0xff, 0xff, 0x3f, 0xb4, 0x41, 0x1b, 0xb4,
|
||||
0x41, 0x36, 0x07, 0x54, 0x01, 0xa3, 0x8e, 0x35, 0xd8, 0x11, 0x83, 0x03,
|
||||
0x00, 0x41, 0x30, 0xc0, 0xf8, 0xc0, 0x0d, 0xa8, 0x6c, 0xc4, 0xc0, 0x01,
|
||||
0x40, 0x10, 0x0c, 0x9a, 0x51, 0x70, 0x83, 0x40, 0xc0, 0x83, 0x01, 0x0e,
|
||||
0xe0, 0x00, 0x0e, 0x38, 0x3b, 0xa8, 0xc4, 0x0e, 0x76, 0xc4, 0xe0, 0x00,
|
||||
0x40, 0x10, 0x0c, 0x30, 0x3f, 0x80, 0x03, 0x6b, 0x1b, 0x31, 0x70, 0x00,
|
||||
0x10, 0x04, 0x83, 0xa6, 0x14, 0xe0, 0x20, 0x10, 0xf4, 0x40, 0xfc, 0xff,
|
||||
0xff, 0xff, 0x07, 0x39, 0x90, 0x03, 0x39, 0xf0, 0xf0, 0x60, 0xc4, 0xa0,
|
||||
0x00, 0x40, 0x10, 0x0c, 0x0c, 0x52, 0x18, 0x83, 0xba, 0x82, 0x19, 0x31,
|
||||
0x30, 0x00, 0x10, 0x04, 0x83, 0xa8, 0x14, 0xc8, 0x20, 0x1a, 0x4d, 0x08,
|
||||
0x80, 0xd1, 0x04, 0x21, 0x18, 0x31, 0x40, 0x00, 0x10, 0x04, 0x83, 0xc9,
|
||||
0x14, 0xcc, 0x00, 0x13, 0x83, 0x31, 0x18, 0x31, 0x40, 0x00, 0x10, 0x04,
|
||||
0x83, 0x09, 0x15, 0xcc, 0x20, 0x1b, 0x03, 0x32, 0x18, 0x31, 0x28, 0x00,
|
||||
0x10, 0x04, 0x83, 0xea, 0x14, 0xcc, 0x60, 0x96, 0x41, 0x59, 0x82, 0x81,
|
||||
0x0a, 0x80, 0x24, 0x80, 0x36, 0x48, 0x06, 0x2a, 0x00, 0x93, 0x00, 0xd2,
|
||||
0x20, 0x19, 0xa8, 0x00, 0x50, 0x02, 0xb8, 0x92, 0x81, 0x0a, 0x40, 0x25,
|
||||
0x80, 0x2b, 0x19, 0xa8, 0x00, 0x58, 0x02, 0x38, 0x83, 0x64, 0x05, 0x43,
|
||||
0x2e, 0x9c, 0x42, 0x40, 0x01, 0x30, 0x86, 0x1b, 0x82, 0x54, 0x00, 0x83,
|
||||
0x59, 0x06, 0x63, 0x08, 0x86, 0x1b, 0x08, 0x3d, 0x20, 0x83, 0x2a, 0xfc,
|
||||
0x40, 0xeb, 0x15, 0x82, 0x9b, 0x65, 0x20, 0x8a, 0xa1, 0x02, 0x64, 0x67,
|
||||
0x09, 0x8c, 0x12, 0x94, 0x9d, 0x25, 0x30, 0x06, 0x3a, 0x00, 0x8b, 0x10,
|
||||
0x0a, 0x4b, 0x18, 0xe8, 0x00, 0x0c, 0xc2, 0x2a, 0x2c, 0x61, 0xb8, 0x61,
|
||||
0x69, 0x03, 0x32, 0x58, 0xc1, 0x30, 0x0e, 0xb2, 0xc0, 0xcc, 0x32, 0x20,
|
||||
0x87, 0x40, 0x01, 0x30, 0x66, 0x09, 0x12, 0x12, 0x80, 0x51, 0x81, 0x04,
|
||||
0xb3, 0x04, 0xc9, 0x40, 0x05, 0x40, 0x20, 0xc6, 0x31, 0x50, 0x01, 0x10,
|
||||
0x08, 0x1a, 0x1c, 0x25, 0x58, 0x60, 0x13, 0x2f, 0xc0, 0x60, 0xb8, 0x21,
|
||||
0xb8, 0x05, 0x30, 0x98, 0x65, 0x08, 0x84, 0x60, 0x05, 0xc3, 0x3a, 0xec,
|
||||
0x02, 0x18, 0x0c, 0x1b, 0x10, 0xc1, 0x37, 0x00, 0x2b, 0x18, 0xd6, 0x81,
|
||||
0x17, 0xc2, 0x60, 0xd8, 0x80, 0x08, 0xba, 0x01, 0x98, 0x25, 0x58, 0x46,
|
||||
0x0c, 0x0c, 0x00, 0x04, 0xc1, 0x00, 0x49, 0x07, 0x57, 0xf0, 0x85, 0xe1,
|
||||
0x06, 0x31, 0xe8, 0x05, 0x30, 0x98, 0x65, 0x70, 0x98, 0x60, 0x96, 0xe0,
|
||||
0x99, 0x25, 0x70, 0x06, 0x2a, 0x00, 0xbe, 0x58, 0x9a, 0x66, 0xb8, 0xa1,
|
||||
0x0c, 0x5e, 0x01, 0x0c, 0x66, 0x19, 0xa0, 0x28, 0x18, 0xa8, 0x00, 0x92,
|
||||
0x07, 0x34, 0x98, 0x81, 0x0a, 0x20, 0x79, 0x44, 0x83, 0x59, 0xc1, 0x10,
|
||||
0x0f, 0xe2, 0x10, 0x50, 0x00, 0x8c, 0x0a, 0x08, 0x30, 0x02, 0x1d, 0x20,
|
||||
0x30, 0xdc, 0x10, 0xac, 0x01, 0x19, 0xcc, 0x32, 0x3c, 0x4d, 0x40, 0xa6,
|
||||
0x00, 0x0c, 0x32, 0x05, 0x60, 0xcc, 0x12, 0x48, 0xc3, 0x0d, 0x6f, 0x60,
|
||||
0x0e, 0x60, 0x30, 0xdd, 0xd0, 0x06, 0xea, 0x10, 0x4c, 0x37, 0xb4, 0xc1,
|
||||
0x3a, 0x08, 0xb3, 0x04, 0xd2, 0x40, 0x05, 0xa0, 0x40, 0x44, 0x34, 0x50,
|
||||
0x01, 0x28, 0x10, 0x11, 0xd5, 0x1f, 0x80, 0xc3, 0x8e, 0x18, 0x1c, 0x00,
|
||||
0x08, 0x82, 0x01, 0x46, 0x0f, 0xe6, 0xc0, 0x0a, 0xb1, 0x30, 0x62, 0xe0,
|
||||
0x00, 0x20, 0x08, 0x06, 0xcd, 0x3e, 0x98, 0x43, 0x20, 0xc0, 0x03, 0x81,
|
||||
0x0e, 0xe8, 0x80, 0x0e, 0xb4, 0xe0, 0x0e, 0x15, 0x0a, 0xf2, 0xb0, 0x23,
|
||||
0x06, 0x07, 0x00, 0x82, 0x60, 0x80, 0xd9, 0x03, 0x3a, 0xb8, 0xc2, 0x2c,
|
||||
0x8c, 0x18, 0x38, 0x00, 0x08, 0x82, 0x41, 0xd3, 0x0f, 0xe8, 0x10, 0x08,
|
||||
0xf2, 0x50, 0xa8, 0x83, 0x3a, 0xa8, 0x83, 0x2d, 0xc0, 0x43, 0x51, 0x73,
|
||||
0x00, 0x45, 0x0a, 0xe7, 0xb0, 0x23, 0x06, 0x07, 0x00, 0x82, 0x60, 0x80,
|
||||
0xe5, 0xc3, 0x3a, 0xc4, 0x82, 0x2d, 0x8c, 0x18, 0x38, 0x00, 0x08, 0x82,
|
||||
0x41, 0x03, 0x12, 0xeb, 0x10, 0x08, 0xf5, 0x30, 0xb4, 0x43, 0x3b, 0xb4,
|
||||
0x43, 0x2e, 0xcc, 0x03, 0x06, 0xc4, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x5b, 0x86, 0x25, 0x08, 0x83, 0x2d, 0x43, 0x13, 0x84, 0xc1, 0x96, 0x21,
|
||||
0x0b, 0xc2, 0x60, 0xcb, 0xf0, 0x06, 0x41, 0x18, 0x6c, 0x19, 0xfe, 0x20,
|
||||
0x08, 0x83, 0x2d, 0x43, 0x28, 0x04, 0x61, 0xb0, 0x65, 0x58, 0x85, 0x20,
|
||||
0x0c, 0xb6, 0x0c, 0xad, 0x10, 0x84, 0xc1, 0x96, 0x41, 0x17, 0x82, 0x30,
|
||||
0xd8, 0x32, 0xfc, 0x42, 0x10, 0x06, 0x5b, 0x06, 0x70, 0x08, 0xc2, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// #671 check 2: 64-lane wave behaviour on hardware that runs narrower waves. A 64-thread group
|
||||
// stands for one console wave of 64 lanes; lane = SV_GroupIndex. Two routes a translator can
|
||||
// take are computed side by side:
|
||||
// shared - every 64-lane operation through groupshared memory and group barriers;
|
||||
// native - the host's own wave operations per hardware wave, merged across waves.
|
||||
// Out[lane*8 + k] for k: 0 ballot lo, 1 ballot hi, 2 exclusive prefix sum, 3 read lane 37,
|
||||
// 4 active sum (shared route); 5 ballot lo, 6 ballot hi, 7 exclusive prefix sum (native).
|
||||
RWStructuredBuffer<uint> Out : register(u0);
|
||||
|
||||
groupshared uint g_pred[64];
|
||||
groupshared uint g_val[64];
|
||||
groupshared uint g_wave_ballot[64]; // one 32-bit ballot word per hardware wave (up to 64 waves)
|
||||
groupshared uint g_wave_sum[64];
|
||||
|
||||
uint value_of(uint lane) { return (lane * 7u + 3u) & 31u; }
|
||||
bool pred_of(uint lane) { return ((lane * 13u + 5u) % 3u) == 0u; }
|
||||
|
||||
[numthreads(64, 1, 1)]
|
||||
void main(uint lane : SV_GroupIndex)
|
||||
{
|
||||
const uint v = value_of(lane);
|
||||
const bool p = pred_of(lane);
|
||||
|
||||
// shared route
|
||||
g_pred[lane] = p ? 1u : 0u;
|
||||
g_val[lane] = v;
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
uint lo = 0, hi = 0, prefix = 0, total = 0;
|
||||
for (uint i = 0; i < 64; ++i) {
|
||||
if (g_pred[i]) { if (i < 32) lo |= 1u << i; else hi |= 1u << (i - 32); }
|
||||
if (i < lane) prefix += g_val[i];
|
||||
total += g_val[i];
|
||||
}
|
||||
Out[lane * 8 + 0] = lo;
|
||||
Out[lane * 8 + 1] = hi;
|
||||
Out[lane * 8 + 2] = prefix;
|
||||
Out[lane * 8 + 3] = g_val[37];
|
||||
Out[lane * 8 + 4] = total;
|
||||
|
||||
// native route: host wave ops within each hardware wave, then merged through groupshared.
|
||||
const uint width = WaveGetLaneCount();
|
||||
const uint wave = lane / width;
|
||||
const uint4 b = WaveActiveBallot(p);
|
||||
const uint wave_prefix = WavePrefixSum(v);
|
||||
const uint wave_sum = WaveActiveSum(v);
|
||||
if (WaveIsFirstLane()) {
|
||||
g_wave_ballot[wave] = b.x; // a 32-lane wave fills one word; wider waves are reported
|
||||
g_wave_sum[wave] = wave_sum;
|
||||
}
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
uint before = 0;
|
||||
for (uint w = 0; w < wave; ++w) before += g_wave_sum[w];
|
||||
uint nlo = 0, nhi = 0;
|
||||
if (width == 32) { nlo = g_wave_ballot[0]; nhi = g_wave_ballot[1]; }
|
||||
else if (width == 64) { nlo = b.x; nhi = b.y; }
|
||||
Out[lane * 8 + 5] = nlo;
|
||||
Out[lane * 8 + 6] = nhi;
|
||||
Out[lane * 8 + 7] = before + wave_prefix;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
add_executable(test_gameinput_keyboard main.cpp)
|
||||
target_link_libraries(test_gameinput_keyboard PRIVATE kernel32 user32 uuid)
|
||||
@@ -0,0 +1,185 @@
|
||||
#include <windows.h>
|
||||
#include <unknwn.h>
|
||||
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr uint32_t gamepad_kind = 0x00040000;
|
||||
constexpr uint32_t keyboard_kind = 0x10;
|
||||
constexpr uint32_t connected = 1;
|
||||
constexpr uint32_t input_enabled = 2;
|
||||
constexpr GUID device_iid = {0x31dd86fb, 0x4c1b, 0x408a, {0x86, 0x8f, 0x43, 0x9b, 0x3c, 0xd4, 0x71, 0x25}};
|
||||
constexpr GUID reading_iid = {0x2156947a, 0xe1fa, 0x4de0, {0xa3, 0x0b, 0xd8, 0x12, 0x93, 0x1d, 0xbd, 0x8d}};
|
||||
struct State {
|
||||
uint32_t buttons;
|
||||
float lt, rt, lx, ly, rx, ry;
|
||||
};
|
||||
static_assert(sizeof(State) == 28);
|
||||
|
||||
template <typename Fn>
|
||||
Fn slot(IUnknown* object, unsigned index) {
|
||||
return reinterpret_cast<Fn>((*reinterpret_cast<void***>(object))[index]);
|
||||
}
|
||||
|
||||
using Create = HRESULT (WINAPI*)(void**);
|
||||
using Current = HRESULT (WINAPI*)(IUnknown*, uint32_t, IUnknown*, IUnknown**);
|
||||
using DeviceCallback = void (WINAPI*)(uint64_t, void*, IUnknown*, uint64_t, uint32_t, uint32_t);
|
||||
using Register = HRESULT (WINAPI*)(IUnknown*, IUnknown*, uint32_t, uint32_t, uint32_t, void*, DeviceCallback, uint64_t*);
|
||||
using Unregister = bool (WINAPI*)(IUnknown*, uint64_t, uint64_t);
|
||||
using StateFn = bool (WINAPI*)(IUnknown*, State*);
|
||||
using Sequence = uint64_t (WINAPI*)(IUnknown*, uint32_t);
|
||||
|
||||
struct Notification {
|
||||
unsigned count = 0;
|
||||
uint64_t token = 0;
|
||||
uint64_t timestamp = 0;
|
||||
uint32_t current = 0;
|
||||
uint32_t previous = 0;
|
||||
IUnknown* device = nullptr;
|
||||
};
|
||||
|
||||
void WINAPI note_device(uint64_t token, void* context, IUnknown* device, uint64_t timestamp,
|
||||
uint32_t current, uint32_t previous) {
|
||||
auto& result = *static_cast<Notification*>(context);
|
||||
result = {result.count + 1, token, timestamp, current, previous, device};
|
||||
}
|
||||
|
||||
void pump_messages() {
|
||||
MSG message;
|
||||
while (PeekMessageW(&message, nullptr, 0, 0, PM_REMOVE)) {
|
||||
TranslateMessage(&message);
|
||||
DispatchMessageW(&message);
|
||||
}
|
||||
}
|
||||
|
||||
bool focus_window(HWND window) {
|
||||
SetForegroundWindow(window);
|
||||
for (unsigned i = 0; i < 40; ++i) {
|
||||
pump_messages();
|
||||
if (GetForegroundWindow() == window) return true;
|
||||
Sleep(10);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
bool keys(const std::array<WORD, N>& bindings, bool down) {
|
||||
std::array<INPUT, N> events{};
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
events[i].type = INPUT_KEYBOARD;
|
||||
events[i].ki.wVk = bindings[i];
|
||||
events[i].ki.dwFlags = down ? 0 : KEYEVENTF_KEYUP;
|
||||
}
|
||||
const bool ok = SendInput(static_cast<UINT>(N), events.data(), sizeof(INPUT)) == N;
|
||||
for (unsigned i = 0; i < 4; ++i) {
|
||||
pump_messages();
|
||||
Sleep(10);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
uint32_t read_u32(const unsigned char* bytes, size_t offset) {
|
||||
uint32_t value;
|
||||
std::memcpy(&value, bytes + offset, sizeof(value));
|
||||
return value;
|
||||
}
|
||||
|
||||
#define REQUIRE(expr) do { if (!(expr)) { \
|
||||
std::fprintf(stderr, "FAIL: GameInput keyboard line %d: %s\n", __LINE__, #expr); return 1; \
|
||||
} } while (false)
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
HMODULE module = LoadLibraryW(L"GameInput.dll");
|
||||
REQUIRE(module);
|
||||
const auto create = reinterpret_cast<Create>(reinterpret_cast<void*>(GetProcAddress(module, MAKEINTRESOURCEA(1))));
|
||||
REQUIRE(create);
|
||||
IUnknown* game_input = nullptr;
|
||||
REQUIRE(create(reinterpret_cast<void**>(&game_input)) == S_OK && game_input);
|
||||
const auto current = slot<Current>(game_input, 4);
|
||||
const auto register_device = slot<Register>(game_input, 9);
|
||||
const auto unregister = slot<Unregister>(game_input, 13);
|
||||
|
||||
Notification pad{};
|
||||
uint64_t token = 0;
|
||||
REQUIRE(register_device(game_input, nullptr, gamepad_kind, connected, 2, &pad, note_device, &token) == S_OK);
|
||||
REQUIRE(pad.count == 1 && pad.token == token && pad.device && pad.timestamp);
|
||||
REQUIRE(pad.current == (connected | input_enabled) && pad.previous == 0);
|
||||
REQUIRE(unregister(game_input, token, 10000));
|
||||
|
||||
Notification filtered{};
|
||||
REQUIRE(register_device(game_input, nullptr, keyboard_kind, connected, 2, &filtered, note_device, &token) == S_OK);
|
||||
REQUIRE(filtered.count == 0 && unregister(game_input, token, 10000));
|
||||
REQUIRE(register_device(game_input, pad.device, gamepad_kind, connected, 0, &filtered, note_device, &token) == S_OK);
|
||||
REQUIRE(filtered.count == 0 && unregister(game_input, token, 10000));
|
||||
|
||||
void* interface_pointer = nullptr;
|
||||
REQUIRE(pad.device->QueryInterface(device_iid, &interface_pointer) == S_OK && interface_pointer == pad.device);
|
||||
static_cast<IUnknown*>(interface_pointer)->Release();
|
||||
using Info = const unsigned char* (WINAPI*)(IUnknown*);
|
||||
const auto info = slot<Info>(pad.device, 3)(pad.device);
|
||||
REQUIRE(info && read_u32(info, 0) == 320 && read_u32(info, 104) == gamepad_kind);
|
||||
using Find = HRESULT (WINAPI*)(IUnknown*, const void*, IUnknown**);
|
||||
IUnknown* found = nullptr;
|
||||
REQUIRE(slot<Find>(game_input, 16)(game_input, info + 32, &found) == S_OK && found == pad.device);
|
||||
found->Release();
|
||||
|
||||
IUnknown* resting = nullptr;
|
||||
REQUIRE(current(game_input, gamepad_kind, pad.device, &resting) == S_OK && resting);
|
||||
REQUIRE(resting->QueryInterface(reading_iid, &interface_pointer) == S_OK && interface_pointer == resting);
|
||||
static_cast<IUnknown*>(interface_pointer)->Release();
|
||||
const auto state = slot<StateFn>(resting, 22);
|
||||
const auto sequence = slot<Sequence>(resting, 4);
|
||||
using GetDevice = void (WINAPI*)(IUnknown*, IUnknown**);
|
||||
slot<GetDevice>(resting, 6)(resting, &found);
|
||||
REQUIRE(found == pad.device);
|
||||
found->Release();
|
||||
State neutral{};
|
||||
REQUIRE(state(resting, &neutral) && neutral.buttons == 0 && neutral.lx == 0 && neutral.rt == 0);
|
||||
REQUIRE(sequence(resting, gamepad_kind) != 0 && sequence(resting, keyboard_kind) == 0);
|
||||
IUnknown* invalid = resting;
|
||||
REQUIRE(current(game_input, gamepad_kind, game_input, &invalid) == static_cast<HRESULT>(0x838a0002u) && !invalid);
|
||||
|
||||
HWND window = CreateWindowExW(0, L"STATIC", L"BetterXen keyboard conformance",
|
||||
WS_VISIBLE | WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
300, 150, nullptr, nullptr, GetModuleHandleW(nullptr), nullptr);
|
||||
REQUIRE(window && focus_window(window));
|
||||
const std::array<WORD, 7> bindings{VK_RETURN, VK_LEFT, 'W', 'D', 'J', 'C', 'Q'};
|
||||
const bool keydown = keys(bindings, true);
|
||||
IUnknown* active = nullptr;
|
||||
const HRESULT active_result = current(game_input, gamepad_kind, pad.device, &active);
|
||||
|
||||
ShowWindow(window, SW_HIDE);
|
||||
pump_messages();
|
||||
IUnknown* unfocused = nullptr;
|
||||
const HRESULT unfocused_result = current(game_input, gamepad_kind, pad.device, &unfocused);
|
||||
const bool keyup = keys(bindings, false);
|
||||
DestroyWindow(window);
|
||||
|
||||
REQUIRE(keydown && keyup && active_result == S_OK && active);
|
||||
REQUIRE(unfocused_result == S_OK && unfocused);
|
||||
State pressed{};
|
||||
REQUIRE(state(active, &pressed));
|
||||
REQUIRE(pressed.buttons == (0x4 | 0x100 | 0x400));
|
||||
REQUIRE(pressed.lt == 0 && pressed.rt == 1);
|
||||
REQUIRE(std::fabs(pressed.lx - 0.70710678f) < 0.001f && std::fabs(pressed.ly - 0.70710678f) < 0.001f);
|
||||
REQUIRE(pressed.rx == -1 && pressed.ry == 0);
|
||||
REQUIRE(state(resting, &neutral) && neutral.buttons == 0);
|
||||
REQUIRE(state(unfocused, &neutral) && neutral.buttons == 0 && neutral.rt == 0 && neutral.lx == 0);
|
||||
REQUIRE(sequence(active, gamepad_kind) > sequence(resting, gamepad_kind));
|
||||
REQUIRE(sequence(unfocused, gamepad_kind) > sequence(active, gamepad_kind));
|
||||
|
||||
unfocused->Release();
|
||||
active->Release();
|
||||
resting->Release();
|
||||
game_input->Release();
|
||||
FreeLibrary(module);
|
||||
std::puts("PASS: GameInput v0 keyboard gamepad enumeration, state, and foreground handling");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
add_executable(test_gameinput_script main.cpp)
|
||||
target_link_libraries(test_gameinput_script PRIVATE kernel32 uuid)
|
||||
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* BX_INPUT_SCRIPT (GameInput diagnostic): scripted gamepad presses for unattended runs.
|
||||
*
|
||||
* The script "A@0.6,DOWN@0.6,B@1.6,BOGUS@1,X" asks for A and DOWN held from 0.6 s to 0.9 s and B
|
||||
* from 1.6 s to 1.9 s after the first reading; the two unreadable entries are skipped. The test has
|
||||
* no window, so the keyboard contributes nothing; readings taken at fixed times must carry exactly
|
||||
* the scripted buttons inside each press and none outside. The times sit at least 0.2 s from every
|
||||
* press boundary.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <unknwn.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr uint32_t gamepad_kind = 0x00040000;
|
||||
constexpr uint32_t connected = 1;
|
||||
struct State {
|
||||
uint32_t buttons;
|
||||
float lt, rt, lx, ly, rx, ry;
|
||||
};
|
||||
static_assert(sizeof(State) == 28);
|
||||
|
||||
template <typename Fn>
|
||||
Fn slot(IUnknown* object, unsigned index) {
|
||||
return reinterpret_cast<Fn>((*reinterpret_cast<void***>(object))[index]);
|
||||
}
|
||||
|
||||
using Create = HRESULT(WINAPI*)(void**);
|
||||
using Current = HRESULT(WINAPI*)(IUnknown*, uint32_t, IUnknown*, IUnknown**);
|
||||
using DeviceCallback = void(WINAPI*)(uint64_t, void*, IUnknown*, uint64_t, uint32_t, uint32_t);
|
||||
using Register = HRESULT(WINAPI*)(IUnknown*, IUnknown*, uint32_t, uint32_t, uint32_t, void*, DeviceCallback, uint64_t*);
|
||||
using StateFn = bool(WINAPI*)(IUnknown*, State*);
|
||||
|
||||
void WINAPI note_device(uint64_t, void* context, IUnknown* device, uint64_t, uint32_t, uint32_t) {
|
||||
*static_cast<IUnknown**>(context) = device;
|
||||
}
|
||||
|
||||
IUnknown* g_input = nullptr;
|
||||
IUnknown* g_pad = nullptr;
|
||||
uint64_t g_start = 0;
|
||||
|
||||
// Waits until `seconds` after the first reading, then returns the buttons of a fresh reading.
|
||||
uint32_t buttons_at(double seconds) {
|
||||
while (GetTickCount64() - g_start < static_cast<uint64_t>(seconds * 1000.0)) Sleep(5);
|
||||
IUnknown* reading = nullptr;
|
||||
if (slot<Current>(g_input, 4)(g_input, gamepad_kind, g_pad, &reading) != S_OK || !reading) return 0xFFFFFFFF;
|
||||
State state{};
|
||||
const bool ok = slot<StateFn>(reading, 22)(reading, &state);
|
||||
reading->Release();
|
||||
return ok ? state.buttons : 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
int g_failed = 0;
|
||||
void expect(const char* what, uint32_t got, uint32_t want) {
|
||||
std::printf("%-34s buttons=0x%x expected=0x%x\n", what, got, want);
|
||||
if (got != want) {
|
||||
std::fprintf(stderr, "FAIL: test_gameinput_script: %s\n", what);
|
||||
++g_failed;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
SetEnvironmentVariableA("BX_INPUT_SCRIPT", "A@0.6,DOWN@0.6,B@1.6,BOGUS@1,X");
|
||||
HMODULE module = LoadLibraryW(L"GameInput.dll");
|
||||
const auto create = module ? reinterpret_cast<Create>(reinterpret_cast<void*>(GetProcAddress(module, MAKEINTRESOURCEA(1)))) : nullptr;
|
||||
if (!create || create(reinterpret_cast<void**>(&g_input)) != S_OK || !g_input) {
|
||||
std::fprintf(stderr, "FAIL: test_gameinput_script: GameInput is not available\n");
|
||||
return 1;
|
||||
}
|
||||
uint64_t token = 0;
|
||||
if (slot<Register>(g_input, 9)(g_input, nullptr, gamepad_kind, connected, 2, &g_pad, note_device, &token) != S_OK || !g_pad) {
|
||||
std::fprintf(stderr, "FAIL: test_gameinput_script: no gamepad device\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_start = GetTickCount64();
|
||||
expect("first reading (0 s)", buttons_at(0.0), 0);
|
||||
expect("0.3 s: before the first press", buttons_at(0.3), 0);
|
||||
expect("0.75 s: A and DOWN held", buttons_at(0.75), 0x4 | 0x80);
|
||||
expect("1.2 s: between presses", buttons_at(1.2), 0);
|
||||
expect("1.75 s: B held", buttons_at(1.75), 0x8);
|
||||
expect("2.2 s: after the script", buttons_at(2.2), 0);
|
||||
|
||||
if (g_failed) return 1;
|
||||
std::puts("PASS: test_gameinput_script");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
add_executable(test_veh_continue_asserts main.cpp)
|
||||
target_link_libraries(test_veh_continue_asserts PRIVATE bx_runtime_veh kernel32)
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* BX_CONTINUE_ASSERTS=1 (bx_runtime_veh diagnostic): an int3 in the main executable is stepped
|
||||
* over, as a continuable assert is when no debugger takes it; an int3 anywhere else is not.
|
||||
*
|
||||
* The test sets the switch, then executes an int3 in its own code twice (the same address, so the
|
||||
* second is a repeat) and once in a page outside any module. A vectored handler of its own,
|
||||
* registered after bx_runtime_veh's, counts every breakpoint that reaches it and steps over it so
|
||||
* the test can report: the executable's int3s must never reach it, the other one must. Stepping
|
||||
* over must leave the thread's last-error value as it was.
|
||||
*/
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
extern "C" uint64_t bx_veh_get_clwb_trap_count(void);
|
||||
|
||||
namespace {
|
||||
|
||||
volatile LONG g_exe_reached = 0;
|
||||
volatile LONG g_other_reached = 0;
|
||||
uintptr_t g_other_page = 0;
|
||||
|
||||
LONG CALLBACK last_handler(PEXCEPTION_POINTERS ep) {
|
||||
if (ep->ExceptionRecord->ExceptionCode != EXCEPTION_BREAKPOINT) return EXCEPTION_CONTINUE_SEARCH;
|
||||
const auto at = reinterpret_cast<uintptr_t>(ep->ExceptionRecord->ExceptionAddress);
|
||||
if (g_other_page && at >= g_other_page && at < g_other_page + 4096) {
|
||||
InterlockedIncrement(&g_other_reached);
|
||||
} else {
|
||||
InterlockedIncrement(&g_exe_reached);
|
||||
}
|
||||
ep->ContextRecord->Rip = at + 1;
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) int assert_site(int value) {
|
||||
__asm__ volatile("int3" ::: "memory");
|
||||
return value + 1;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
SetErrorMode(SEM_NOGPFAULTERRORBOX);
|
||||
// Keep a static import on bx_runtime_veh.dll so its handler is installed at load.
|
||||
volatile uint64_t attached = bx_veh_get_clwb_trap_count();
|
||||
(void)attached;
|
||||
SetEnvironmentVariableA("BX_CONTINUE_ASSERTS", "1");
|
||||
AddVectoredExceptionHandler(0, last_handler);
|
||||
|
||||
SetLastError(0x1234);
|
||||
int value = assert_site(1);
|
||||
value = assert_site(value);
|
||||
const DWORD last_error = GetLastError();
|
||||
|
||||
// An int3 outside any module: int3; ret.
|
||||
auto* page = static_cast<uint8_t*>(VirtualAlloc(nullptr, 4096, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE));
|
||||
if (!page) return 1;
|
||||
g_other_page = reinterpret_cast<uintptr_t>(page);
|
||||
page[0] = 0xCC;
|
||||
page[1] = 0xC3;
|
||||
FlushInstructionCache(GetCurrentProcess(), page, 2);
|
||||
reinterpret_cast<void (*)()>(page)();
|
||||
|
||||
int failed = 0;
|
||||
if (value != 3) {
|
||||
std::fprintf(stderr, "FAIL: test_veh_continue_asserts: execution after the int3 did not continue (value %d)\n", value);
|
||||
++failed;
|
||||
}
|
||||
if (last_error != 0x1234) {
|
||||
std::fprintf(stderr, "FAIL: test_veh_continue_asserts: a stepped-over int3 changed the last-error value (0x%lx)\n",
|
||||
static_cast<unsigned long>(last_error));
|
||||
++failed;
|
||||
}
|
||||
if (g_exe_reached != 0) {
|
||||
std::fprintf(stderr, "FAIL: test_veh_continue_asserts: %ld int3s in the executable were not stepped over\n",
|
||||
static_cast<long>(g_exe_reached));
|
||||
++failed;
|
||||
}
|
||||
if (g_other_reached != 1) {
|
||||
std::fprintf(stderr, "FAIL: test_veh_continue_asserts: an int3 outside the executable must be left alone (reached %ld)\n",
|
||||
static_cast<long>(g_other_reached));
|
||||
++failed;
|
||||
}
|
||||
VirtualFree(page, 0, MEM_RELEASE);
|
||||
if (failed) return 1;
|
||||
std::puts("PASS: test_veh_continue_asserts");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# Synthetic conformance test: Xbox DirectStorage requests whose destination is an array of
|
||||
# xmem.dll physical pages (DestinationIsPhysicalPages).
|
||||
add_executable(test_xcrdapi_page_destination main.cpp)
|
||||
target_compile_definitions(test_xcrdapi_page_destination PRIVATE WIDL_EXPLICIT_AGGREGATE_RETURNS)
|
||||
target_include_directories(test_xcrdapi_page_destination PRIVATE "${BX_ABI_INCLUDE_DIR}" "${BX_ROOT_DIR}/shims/xcrdapi/dstorage")
|
||||
target_link_libraries(test_xcrdapi_page_destination PRIVATE xcrdapi xmem bx_runtime_veh kernel32)
|
||||
@@ -0,0 +1,450 @@
|
||||
/*
|
||||
* Synthetic conformance test: Xbox DirectStorage requests whose destination is an array of
|
||||
* physical pages (DSTORAGE_REQUEST_OPTIONS.DestinationIsPhysicalPages).
|
||||
*
|
||||
* Contract, from the authorized GDK header and documentation of DSTORAGE_REQUEST:
|
||||
* - DestinationIsPhysicalPages is bit 21 of the options (after ZlibDecompress:1, BcpackMode:4,
|
||||
* SwizzleMode:16); SourceType is bit 22 and SourceIsPhysicalPages bit 23.
|
||||
* - With it, the destination union holds DestinationPageArray (an array of 64 KB page numbers
|
||||
* from XMemAllocatePhysicalPages) at +0x08 and DestinationPageOffset (UINT16, the offset into
|
||||
* the first page where the destination starts) at +0x10.
|
||||
* - DestinationSize bytes are written from that offset, page after page in array order.
|
||||
* The 56-byte request layout is the one test_xcrdapi_xbox already uses.
|
||||
*
|
||||
* The expected bytes are built here from a formula; the zlib stream was produced from the same
|
||||
* formula by CPython's zlib module (level 9), not by the code under test.
|
||||
*/
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "dstorage.h"
|
||||
|
||||
extern "C" {
|
||||
__declspec(dllimport) HRESULT WINAPI DStorageGetFactory(REFIID riid, void** ppv);
|
||||
PVOID WINAPI XMemVirtualAlloc(PVOID, SIZE_T, DWORD, uint64_t, DWORD);
|
||||
BOOL WINAPI XMemAllocatePhysicalPages(uint64_t, PULONG_PTR, PULONG_PTR);
|
||||
BOOL WINAPI XMemFreePhysicalPages(ULONG_PTR, PULONG_PTR);
|
||||
PVOID WINAPI XMemMapPhysicalPages(PVOID, ULONG_PTR, PULONG_PTR);
|
||||
}
|
||||
|
||||
struct XboxQueueDesc {
|
||||
UINT64 source_type;
|
||||
UINT16 capacity;
|
||||
INT8 priority;
|
||||
UINT8 reserved_pad[5];
|
||||
PCSTR name;
|
||||
UINT64 flags;
|
||||
};
|
||||
|
||||
struct XboxRequest {
|
||||
UINT64 options;
|
||||
void* destination; // DestinationPageArray when bit 21 is set
|
||||
UINT16 destination_page_offset; // DestinationPageOffset
|
||||
UINT16 reserved12;
|
||||
UINT32 reserved14;
|
||||
UINT32 destination_size;
|
||||
UINT32 reserved1c;
|
||||
void* source_ptr;
|
||||
UINT64 file_offset;
|
||||
UINT32 source_size;
|
||||
UINT32 reserved34;
|
||||
};
|
||||
static_assert(sizeof(XboxRequest) == 56, "DSTORAGE_REQUEST is 56 bytes");
|
||||
static_assert(offsetof(XboxRequest, destination_page_offset) == 0x10, "DestinationPageOffset at +0x10");
|
||||
static_assert(offsetof(XboxRequest, destination_size) == 0x18, "DestinationSize at +0x18");
|
||||
|
||||
struct IXboxDStorageFile : IUnknown {
|
||||
virtual void STDMETHODCALLTYPE Close() = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFileInformation(BY_HANDLE_FILE_INFORMATION* info) = 0;
|
||||
};
|
||||
|
||||
struct IXboxDStorageStatusArray : IUnknown {
|
||||
virtual bool STDMETHODCALLTYPE IsComplete(UINT32 index) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetHResult(UINT32 index) = 0;
|
||||
};
|
||||
|
||||
struct IXboxDStorageQueue : IUnknown {
|
||||
virtual void STDMETHODCALLTYPE EnqueueRequest(const XboxRequest* request) = 0;
|
||||
virtual void STDMETHODCALLTYPE EnqueueStatus(IXboxDStorageStatusArray* status_array, UINT32 index) = 0;
|
||||
virtual void STDMETHODCALLTYPE EnqueueSignal(void* fence, UINT64 value) = 0;
|
||||
virtual void STDMETHODCALLTYPE Submit() = 0;
|
||||
virtual void STDMETHODCALLTYPE CancelRequestsWithTag(UINT64 mask, UINT64 value) = 0;
|
||||
virtual void STDMETHODCALLTYPE Close() = 0;
|
||||
};
|
||||
|
||||
struct IXboxDStorageFactory : IUnknown {
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateQueue(const void* desc, REFIID riid, void** ppv) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE OpenFile(const WCHAR* path, REFIID riid, void** ppv) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateStatusArray(UINT32 capacity, PCSTR name, REFIID riid, void** ppv) = 0;
|
||||
virtual void STDMETHODCALLTYPE SetDebugFlags(UINT32 flags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE StubSlot7() = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetStagingBufferSize(UINT32 size) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE StubSlot9() = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateQueueX(const XboxQueueDesc* desc, REFIID riid, void** ppv) = 0;
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr IID kXboxFactoryIid{0x62959d11, 0xd45f, 0x4884, {0xa0, 0xa3, 0xf7, 0x86, 0x2e, 0xa2, 0x43, 0xae}};
|
||||
constexpr IID kXboxFileIid{0x43704f9f, 0x27c6, 0x4a9f, {0x88, 0x15, 0xd1, 0x65, 0x27, 0x89, 0x4d, 0xf4}};
|
||||
constexpr IID kXboxStatusArrayIid{0xcd66d752, 0x2786, 0x44f7, {0x90, 0x70, 0xe2, 0xa6, 0xfd, 0xad, 0x3f, 0x1b}};
|
||||
constexpr IID kXboxQueueIid{0x3c02cb0c, 0xc050, 0x4195, {0x99, 0xa1, 0xa1, 0xce, 0x94, 0xba, 0x33, 0xc5}};
|
||||
|
||||
// DSTORAGE_REQUEST_OPTIONS bits (authorized GDK header).
|
||||
constexpr UINT64 kZlibDecompress = 1ull << 0;
|
||||
constexpr UINT64 kDestinationIsPhysicalPages = 1ull << 21;
|
||||
constexpr UINT64 kSourceTypeMemory = 1ull << 22;
|
||||
constexpr UINT64 kSourceIsPhysicalPages = 1ull << 23;
|
||||
|
||||
// xmem constants (authorized GDK documentation, as in test_xmem_physical).
|
||||
constexpr SIZE_T kPage = 64 * 1024;
|
||||
constexpr DWORD kMem64KPages = 0x20400000;
|
||||
constexpr uint64_t kXMemCpu = 0x1;
|
||||
constexpr uint64_t kXMemMappable = 0x20;
|
||||
constexpr BYTE kFill = 0xCC;
|
||||
|
||||
int g_failed = 0;
|
||||
int g_checks = 0;
|
||||
|
||||
void check(bool cond, const char* fmt, ...) {
|
||||
++g_checks;
|
||||
if (cond) return;
|
||||
++g_failed;
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
std::fprintf(stderr, "FAIL: ");
|
||||
std::vfprintf(stderr, fmt, args);
|
||||
std::fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
bool wait_complete(IXboxDStorageStatusArray* status, UINT32 index) {
|
||||
for (int i = 0; i < 500; ++i) {
|
||||
if (status->IsComplete(index)) return true;
|
||||
Sleep(10);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* "pg %04d;" for i % 251, i = 0..16999 (136000 bytes), zlib level 9 (CPython). */
|
||||
constexpr size_t kPlainSize = 136000;
|
||||
const uint8_t kZlibStream[] = {
|
||||
0x78, 0xda, 0xed, 0xd5, 0xbb, 0x0d, 0x05, 0x86, 0x0d, 0x04, 0xc1, 0x56, 0x5c, 0x82, 0x8e, 0xef,
|
||||
0x0f, 0x17, 0xe4, 0x54, 0xfd, 0x47, 0x16, 0xac, 0x75, 0x09, 0xca, 0x86, 0x09, 0xb3, 0xcb, 0x16,
|
||||
0xf3, 0xe7, 0x7f, 0xfe, 0xf5, 0xc7, 0x5f, 0xf7, 0xef, 0x3f, 0xff, 0xf7, 0xd7, 0xbf, 0xfe, 0xa3,
|
||||
0xff, 0xec, 0xbf, 0xfa, 0xef, 0xfe, 0xa7, 0xff, 0xed, 0xff, 0xfe, 0xfe, 0x6b, 0x6f, 0xed, 0xad,
|
||||
0xbd, 0xb5, 0xb7, 0xf6, 0xd6, 0xde, 0xda, 0x5b, 0x7b, 0x6b, 0x6f, 0xed, 0x5d, 0x7b, 0xd7, 0xde,
|
||||
0xb5, 0x77, 0xed, 0x5d, 0x7b, 0xd7, 0xde, 0xb5, 0x77, 0xed, 0x5d, 0x7b, 0xd7, 0xde, 0xa3, 0xbd,
|
||||
0x47, 0x7b, 0x8f, 0xf6, 0x1e, 0xed, 0x3d, 0xda, 0x7b, 0xb4, 0xf7, 0x68, 0xef, 0xd1, 0xde, 0xa3,
|
||||
0xbd, 0x47, 0x7b, 0xcf, 0xf6, 0x9e, 0xed, 0x3d, 0xdb, 0x7b, 0xb6, 0xf7, 0x6c, 0xef, 0xd9, 0xde,
|
||||
0xb3, 0xbd, 0x67, 0x7b, 0xcf, 0xf6, 0x9e, 0xed, 0xbd, 0xda, 0x7b, 0xb5, 0xf7, 0x6a, 0xef, 0xd5,
|
||||
0xde, 0xab, 0xbd, 0x57, 0x7b, 0xaf, 0xf6, 0x5e, 0xed, 0xbd, 0xda, 0x7b, 0xb5, 0xf7, 0x6e, 0xef,
|
||||
0xdd, 0xde, 0xbb, 0xbd, 0x77, 0x7b, 0xef, 0xf6, 0xde, 0xed, 0xbd, 0xdb, 0x7b, 0xb7, 0xf7, 0x6e,
|
||||
0xef, 0xdd, 0xde, 0xa7, 0xbd, 0x4f, 0x7b, 0x9f, 0xf6, 0x3e, 0xed, 0x7d, 0xda, 0xfb, 0xb4, 0xf7,
|
||||
0x69, 0xef, 0xd3, 0xde, 0xa7, 0xbd, 0x4f, 0x7b, 0xdf, 0xf6, 0xbe, 0xed, 0x7d, 0xdb, 0xfb, 0xb6,
|
||||
0xf7, 0x6d, 0xef, 0xdb, 0xde, 0xb7, 0xbd, 0x6f, 0x7b, 0xdf, 0xf6, 0xbe, 0xed, 0xfd, 0xda, 0xfb,
|
||||
0xb5, 0xf7, 0x6b, 0xef, 0xd7, 0xde, 0xaf, 0xbd, 0x5f, 0x7b, 0xbf, 0xf6, 0x7e, 0xed, 0xfd, 0xda,
|
||||
0xfb, 0xfd, 0xbd, 0xb7, 0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea,
|
||||
0x63, 0xf5, 0xb1, 0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63,
|
||||
0xf5, 0xb1, 0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5,
|
||||
0xb1, 0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1,
|
||||
0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa,
|
||||
0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa, 0x58,
|
||||
0x7d, 0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa, 0x58, 0x7d,
|
||||
0xac, 0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa, 0x58, 0x7d, 0xac,
|
||||
0x3e, 0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa, 0x58, 0x7d, 0xac, 0x3e,
|
||||
0x56, 0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56,
|
||||
0x1f, 0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f,
|
||||
0xab, 0x8f, 0xd5, 0xc7, 0xea, 0x63, 0xf5, 0xb1, 0xfa, 0x58, 0x7d, 0xac, 0x3e, 0x56, 0x1f, 0x57,
|
||||
0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57,
|
||||
0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57,
|
||||
0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57,
|
||||
0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57,
|
||||
0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57,
|
||||
0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57, 0x1f, 0x57,
|
||||
0x1f, 0x57, 0x1f, 0xf7, 0x7f, 0x3f, 0xb8, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a,
|
||||
0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae,
|
||||
0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7,
|
||||
0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75,
|
||||
0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c,
|
||||
0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce,
|
||||
0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb,
|
||||
0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9,
|
||||
0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d,
|
||||
0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7,
|
||||
0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73,
|
||||
0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a,
|
||||
0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae,
|
||||
0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7,
|
||||
0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75,
|
||||
0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c,
|
||||
0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce,
|
||||
0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb,
|
||||
0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9,
|
||||
0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d,
|
||||
0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7,
|
||||
0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73,
|
||||
0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a,
|
||||
0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae,
|
||||
0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7,
|
||||
0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75,
|
||||
0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c,
|
||||
0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce,
|
||||
0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb,
|
||||
0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9,
|
||||
0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d,
|
||||
0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7,
|
||||
0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73,
|
||||
0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a,
|
||||
0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae,
|
||||
0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7,
|
||||
0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75,
|
||||
0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c,
|
||||
0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce,
|
||||
0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb,
|
||||
0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9,
|
||||
0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d,
|
||||
0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7,
|
||||
0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73,
|
||||
0x9d, 0xeb, 0x5c, 0xe7, 0x3a, 0xd7, 0xb9, 0xce, 0x75, 0xae, 0x73, 0x9d, 0xeb, 0x5c, 0xe7, 0xfa,
|
||||
0x3f, 0xe2, 0xfa, 0x7f, 0x01, 0xc6, 0xe2, 0x9e, 0xc4,
|
||||
};
|
||||
|
||||
char g_plain[kPlainSize + 1];
|
||||
|
||||
void build_plain() {
|
||||
for (int i = 0, at = 0; i < 17000; ++i) {
|
||||
at += std::snprintf(g_plain + at, sizeof(g_plain) - at, "pg %04d;", i % 251);
|
||||
}
|
||||
}
|
||||
|
||||
// The title's view: its four pages mapped in allocation order at `view`.
|
||||
BYTE* g_view = nullptr;
|
||||
ULONG_PTR g_pages[4] = {};
|
||||
|
||||
BYTE* page_in_view(ULONG_PTR number) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (g_pages[i] == number) return g_view + i * kPage;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void fill_view() { std::memset(g_view, kFill, 4 * kPage); }
|
||||
|
||||
// Checks that `size` bytes of `expected` were written from `offset` through `array` (in array
|
||||
// order), and that every other byte of the four pages kept the fill.
|
||||
void check_written(const char* what, const ULONG_PTR* array, size_t count, size_t offset, const void* expected,
|
||||
size_t size) {
|
||||
static BYTE want[4 * kPage];
|
||||
std::memset(want, kFill, sizeof(want));
|
||||
const auto* src = static_cast<const BYTE*>(expected);
|
||||
for (size_t j = 0; j < size; ++j) {
|
||||
const size_t at = offset + j;
|
||||
const size_t k = at / kPage;
|
||||
if (k >= count) break;
|
||||
BYTE* page = page_in_view(array[k]);
|
||||
want[(page - g_view) + at % kPage] = src[j];
|
||||
}
|
||||
size_t first_bad = SIZE_MAX;
|
||||
for (size_t i = 0; i < sizeof(want) && first_bad == SIZE_MAX; ++i) {
|
||||
if (g_view[i] != want[i]) first_bad = i;
|
||||
}
|
||||
check(first_bad == SIZE_MAX, "%s: page bytes differ first at page %zu offset 0x%zx (got 0x%02x, want 0x%02x)",
|
||||
what, first_bad / kPage, first_bad % kPage, first_bad == SIZE_MAX ? 0 : g_view[first_bad],
|
||||
first_bad == SIZE_MAX ? 0 : want[first_bad]);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
build_plain();
|
||||
|
||||
ULONG_PTR count = 4;
|
||||
check(XMemAllocatePhysicalPages(0, &count, g_pages) && count == 4, "XMemAllocatePhysicalPages(4) must succeed");
|
||||
g_view = static_cast<BYTE*>(
|
||||
XMemVirtualAlloc(nullptr, 4 * kPage, MEM_RESERVE | kMem64KPages, kXMemMappable | kXMemCpu, PAGE_READWRITE));
|
||||
check(g_view && XMemMapPhysicalPages(g_view, 4, g_pages) == g_view, "the title view of the pages must map");
|
||||
if (g_failed) return 1;
|
||||
|
||||
IXboxDStorageFactory* factory = nullptr;
|
||||
HRESULT hr = DStorageGetFactory(kXboxFactoryIid, reinterpret_cast<void**>(&factory));
|
||||
check(hr == S_OK && factory, "DStorageGetFactory(Xbox) must succeed (hr=0x%08lx)", static_cast<unsigned long>(hr));
|
||||
IXboxDStorageStatusArray* status = nullptr;
|
||||
hr = factory ? factory->CreateStatusArray(8, "pages", kXboxStatusArrayIid, reinterpret_cast<void**>(&status)) : E_FAIL;
|
||||
check(hr == S_OK && status, "CreateStatusArray must succeed (hr=0x%08lx)", static_cast<unsigned long>(hr));
|
||||
if (g_failed) return 1;
|
||||
|
||||
/* 1. File source, zlib, into three pages given out of order, starting 0x9000 into the first:
|
||||
* 136000 bytes from 0x9000 end in the third page. */
|
||||
WCHAR temp_dir[MAX_PATH] = {};
|
||||
WCHAR zlib_file[MAX_PATH] = {};
|
||||
check(GetTempPathW(MAX_PATH, temp_dir) > 0 && GetTempFileNameW(temp_dir, L"bxp", 0, zlib_file) != 0,
|
||||
"a temporary file name must be available");
|
||||
HANDLE raw = CreateFileW(zlib_file, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (raw != INVALID_HANDLE_VALUE) {
|
||||
BYTE prefix[100];
|
||||
std::memset(prefix, 0x5A, sizeof(prefix));
|
||||
DWORD written = 0;
|
||||
check(WriteFile(raw, prefix, sizeof(prefix), &written, nullptr) &&
|
||||
WriteFile(raw, kZlibStream, sizeof(kZlibStream), &written, nullptr) && written == sizeof(kZlibStream),
|
||||
"the zlib payload must be written");
|
||||
CloseHandle(raw);
|
||||
}
|
||||
IXboxDStorageFile* file = nullptr;
|
||||
hr = factory->OpenFile(zlib_file, kXboxFileIid, reinterpret_cast<void**>(&file));
|
||||
check(hr == S_OK && file, "OpenFile must succeed (hr=0x%08lx)", static_cast<unsigned long>(hr));
|
||||
|
||||
XboxQueueDesc file_desc{};
|
||||
file_desc.capacity = 16;
|
||||
file_desc.name = "page_file_queue";
|
||||
IXboxDStorageQueue* file_q = nullptr;
|
||||
hr = factory->CreateQueueX(&file_desc, kXboxQueueIid, reinterpret_cast<void**>(&file_q));
|
||||
check(hr == S_OK && file_q, "CreateQueueX(file) must succeed (hr=0x%08lx)", static_cast<unsigned long>(hr));
|
||||
|
||||
if (file && file_q) {
|
||||
ULONG_PTR array[] = {g_pages[2], g_pages[0], g_pages[1]};
|
||||
fill_view();
|
||||
XboxRequest r{};
|
||||
r.options = kZlibDecompress | kDestinationIsPhysicalPages;
|
||||
r.destination = array;
|
||||
r.destination_page_offset = 0x9000;
|
||||
r.destination_size = kPlainSize;
|
||||
r.source_ptr = file;
|
||||
r.file_offset = 100;
|
||||
r.source_size = sizeof(kZlibStream);
|
||||
file_q->EnqueueRequest(&r);
|
||||
file_q->EnqueueStatus(status, 0);
|
||||
file_q->Submit();
|
||||
check(wait_complete(status, 0) && status->GetHResult(0) == S_OK,
|
||||
"zlib file request into physical pages must succeed (hr=0x%08lx)",
|
||||
static_cast<unsigned long>(status->GetHResult(0)));
|
||||
check_written("zlib file request", array, 3, 0x9000, g_plain, kPlainSize);
|
||||
|
||||
/* 2. A page number that was never allocated fails the request and writes nothing. */
|
||||
ULONG_PTR bad[] = {g_pages[3], g_pages[0] + g_pages[1] + g_pages[2] + g_pages[3] + 16 * 1024};
|
||||
fill_view();
|
||||
XboxRequest b = r;
|
||||
b.destination = bad;
|
||||
b.destination_page_offset = 0;
|
||||
b.destination_size = static_cast<UINT32>(kPage + 16);
|
||||
b.source_size = sizeof(kZlibStream);
|
||||
file_q->EnqueueRequest(&b);
|
||||
file_q->EnqueueStatus(status, 1);
|
||||
file_q->Submit();
|
||||
check(wait_complete(status, 1) && FAILED(status->GetHResult(1)),
|
||||
"a request naming an unallocated page must fail (hr=0x%08lx)",
|
||||
static_cast<unsigned long>(status->GetHResult(1)));
|
||||
check_written("unallocated page", bad, 0, 0, g_plain, 0);
|
||||
|
||||
/* 5. A title may read only the first part of a compressed block: a 4096-byte destination
|
||||
* from the 136000-byte stream receives exactly the stream's first 4096 bytes, and the
|
||||
* bytes after the destination keep their fill. */
|
||||
static BYTE part[4096 + 64];
|
||||
std::memset(part, 0xA5, sizeof(part));
|
||||
XboxRequest f{};
|
||||
f.options = kZlibDecompress;
|
||||
f.destination = part;
|
||||
f.destination_size = 4096;
|
||||
f.source_ptr = file;
|
||||
f.file_offset = 100;
|
||||
f.source_size = sizeof(kZlibStream);
|
||||
file_q->EnqueueRequest(&f);
|
||||
file_q->EnqueueStatus(status, 4);
|
||||
file_q->Submit();
|
||||
check(wait_complete(status, 4) && status->GetHResult(4) == S_OK,
|
||||
"a zlib request for the first 4096 bytes of a longer stream must succeed (hr=0x%08lx)",
|
||||
static_cast<unsigned long>(status->GetHResult(4)));
|
||||
check(std::memcmp(part, g_plain, 4096) == 0, "the first 4096 bytes of the stream must be delivered");
|
||||
bool tail_kept = true;
|
||||
for (size_t i = 4096; i < sizeof(part); ++i) tail_kept = tail_kept && part[i] == 0xA5;
|
||||
check(tail_kept, "bytes after a partial zlib destination must not be written");
|
||||
file_q->Close();
|
||||
}
|
||||
|
||||
/* 3. Memory source, uncompressed, 64 bytes across a page boundary (0xFFE0 in the first page). */
|
||||
XboxQueueDesc mem_desc{};
|
||||
mem_desc.source_type = 1;
|
||||
mem_desc.capacity = 16;
|
||||
mem_desc.name = "page_memory_queue";
|
||||
IXboxDStorageQueue* mem_q = nullptr;
|
||||
hr = factory->CreateQueueX(&mem_desc, kXboxQueueIid, reinterpret_cast<void**>(&mem_q));
|
||||
check(hr == S_OK && mem_q, "CreateQueueX(memory) must succeed (hr=0x%08lx)", static_cast<unsigned long>(hr));
|
||||
if (mem_q) {
|
||||
BYTE source[64];
|
||||
for (int i = 0; i < 64; ++i) source[i] = static_cast<BYTE>(0x80 + i);
|
||||
ULONG_PTR array[] = {g_pages[3], g_pages[1]};
|
||||
fill_view();
|
||||
XboxRequest m{};
|
||||
m.options = kSourceTypeMemory | kDestinationIsPhysicalPages;
|
||||
m.destination = array;
|
||||
m.destination_page_offset = 0xFFE0;
|
||||
m.destination_size = sizeof(source);
|
||||
m.source_ptr = source;
|
||||
m.source_size = sizeof(source);
|
||||
mem_q->EnqueueRequest(&m);
|
||||
mem_q->EnqueueStatus(status, 2);
|
||||
mem_q->Submit();
|
||||
check(wait_complete(status, 2) && status->GetHResult(2) == S_OK,
|
||||
"memory request into physical pages must succeed (hr=0x%08lx)",
|
||||
static_cast<unsigned long>(status->GetHResult(2)));
|
||||
check_written("memory request", array, 2, 0xFFE0, source, sizeof(source));
|
||||
|
||||
/* 4. A physical-page source is not implemented: refused with E_NOTIMPL, nothing written. */
|
||||
fill_view();
|
||||
XboxRequest s = m;
|
||||
s.options = kSourceTypeMemory | kSourceIsPhysicalPages;
|
||||
s.destination = source;
|
||||
s.destination_page_offset = 0;
|
||||
s.source_ptr = array;
|
||||
mem_q->EnqueueRequest(&s);
|
||||
mem_q->EnqueueStatus(status, 3);
|
||||
mem_q->Submit();
|
||||
check(wait_complete(status, 3) && status->GetHResult(3) == E_NOTIMPL,
|
||||
"a physical-page source must be refused with E_NOTIMPL (hr=0x%08lx)",
|
||||
static_cast<unsigned long>(status->GetHResult(3)));
|
||||
check_written("physical-page source", array, 0, 0, source, 0);
|
||||
|
||||
/* 6. The title fills its page array after EnqueueRequest returns and before it submits:
|
||||
* the pages it names then are the ones written. */
|
||||
ULONG_PTR late[2] = {0, 0};
|
||||
fill_view();
|
||||
XboxRequest l = m;
|
||||
l.destination = late;
|
||||
l.destination_page_offset = 0x100;
|
||||
mem_q->EnqueueRequest(&l);
|
||||
late[0] = g_pages[2];
|
||||
late[1] = g_pages[0];
|
||||
mem_q->EnqueueStatus(status, 5);
|
||||
mem_q->Submit();
|
||||
check(wait_complete(status, 5) && status->GetHResult(5) == S_OK,
|
||||
"a page array filled after EnqueueRequest must be used (hr=0x%08lx)",
|
||||
static_cast<unsigned long>(status->GetHResult(5)));
|
||||
check_written("page array filled after enqueue", late, 1, 0x100, source, sizeof(source));
|
||||
mem_q->Close();
|
||||
mem_q->Release();
|
||||
}
|
||||
|
||||
if (file_q) file_q->Release();
|
||||
if (file) {
|
||||
file->Close();
|
||||
file->Release();
|
||||
}
|
||||
DeleteFileW(zlib_file);
|
||||
status->Release();
|
||||
factory->Release();
|
||||
|
||||
/* The request's own mapping is gone: the pages can be unmapped and freed. */
|
||||
check(XMemMapPhysicalPages(g_view, 4, nullptr) == g_view, "the title view must unmap");
|
||||
check(XMemFreePhysicalPages(4, g_pages), "the pages must be freed");
|
||||
|
||||
if (g_failed) {
|
||||
std::fprintf(stderr, "test_xcrdapi_page_destination: %d of %d checks failed\n", g_failed, g_checks);
|
||||
return 1;
|
||||
}
|
||||
std::printf("test_xcrdapi_page_destination: PASS (%d checks)\n", g_checks);
|
||||
return 0;
|
||||
}
|
||||
@@ -5,7 +5,15 @@
|
||||
* view in one step, so XCRDAPI.dll brackets its stores with xmem.dll's remap guard
|
||||
* (bx_xmem_remap_guard_enter / _leave) and the remapping calls wait for it. Memory requests that
|
||||
* span the window are queued while the window is remapped over and over; without the guard a
|
||||
* store lands in a gap and the process dies in an access violation.
|
||||
* store lands in a gap and the process dies in an access violation. Three request shapes, each
|
||||
* for about 2 s:
|
||||
* 1. memory to memory into the window (public DirectStorage interface): stores;
|
||||
* 2. a zlib stream inflated into the window for about 4 s (BetterXen's request interface):
|
||||
* stores and back-reference loads by the inflater;
|
||||
* 3. memory to memory out of the window into private memory: loads, which fault in the gap
|
||||
* like stores.
|
||||
* The zlib stream is built here by hand (RFC 1950/1951, fixed Huffman codes), so the expected
|
||||
* output does not come from the code under test.
|
||||
*/
|
||||
#include <windows.h>
|
||||
|
||||
@@ -15,6 +23,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "dstorage_mingw.h"
|
||||
#include "synthetic_storage.h"
|
||||
|
||||
extern "C" {
|
||||
PVOID WINAPI XMemVirtualAlloc(PVOID, SIZE_T, DWORD, uint64_t, DWORD);
|
||||
@@ -50,6 +59,62 @@ struct Com {
|
||||
void** out() { return reinterpret_cast<void**>(&value); }
|
||||
};
|
||||
|
||||
// RFC 1950 stream for `count` copies of `byte`: one fixed-Huffman deflate block (RFC 1951
|
||||
// 3.2.6) holding the byte as a literal, then copies of distance 1 (length 258, and one shorter
|
||||
// copy for the rest), then end of block; adler-32 at the end.
|
||||
class BitWriter {
|
||||
public:
|
||||
std::vector<unsigned char> bytes;
|
||||
void bits(uint32_t value, int n) { // LSB first, as deflate packs header and extra bits
|
||||
for (int i = 0; i < n; ++i) put((value >> i) & 1u);
|
||||
}
|
||||
void code(uint32_t value, int n) { // Huffman codes are packed most significant bit first
|
||||
for (int i = n - 1; i >= 0; --i) put((value >> i) & 1u);
|
||||
}
|
||||
|
||||
private:
|
||||
void put(uint32_t bit) {
|
||||
if (used_ == 0) bytes.push_back(0);
|
||||
bytes.back() |= static_cast<unsigned char>(bit << used_);
|
||||
used_ = (used_ + 1) & 7;
|
||||
}
|
||||
int used_ = 0;
|
||||
};
|
||||
|
||||
std::vector<unsigned char> zlib_repeat(unsigned char byte, uint32_t count) {
|
||||
BitWriter w;
|
||||
w.bits(1, 1); // BFINAL
|
||||
w.bits(1, 2); // BTYPE = 01, fixed Huffman codes
|
||||
w.code(0x30u + byte, 8); // literals 0-143: 8-bit codes 00110000 + value
|
||||
uint32_t left = count - 1;
|
||||
while (left) {
|
||||
if (left >= 258) {
|
||||
w.code(0xC0u + (285 - 280), 8); // length 258: symbol 285, codes 280-287 are 11000000 + n
|
||||
left -= 258;
|
||||
} else {
|
||||
// Lengths 3..257 below 258 use symbols 257-284 with extra bits; this stream only needs
|
||||
// what is left after 258-byte copies, which the test keeps at 15 (symbol 267: lengths
|
||||
// 15-16, 1 extra bit).
|
||||
if (left != 15) return {};
|
||||
w.code(267 - 256, 7); // symbols 256-279: 7-bit codes 0000000 + (n - 256)
|
||||
w.bits(0, 1); // extra bit: 15 = base 15 + 0
|
||||
left = 0;
|
||||
}
|
||||
w.code(0, 5); // distance code 0 = distance 1, 5-bit fixed code, no extra bits
|
||||
}
|
||||
w.code(0, 7); // end of block: symbol 256
|
||||
std::vector<unsigned char> out = {0x78, 0x01};
|
||||
out.insert(out.end(), w.bytes.begin(), w.bytes.end());
|
||||
uint32_t a = 1, b = 0;
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
a = (a + byte) % 65521;
|
||||
b = (b + a) % 65521;
|
||||
}
|
||||
const uint32_t adler = (b << 16) | a;
|
||||
for (int shift = 24; shift >= 0; shift -= 8) out.push_back(static_cast<unsigned char>(adler >> shift));
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
@@ -101,8 +166,77 @@ int main() {
|
||||
++batches;
|
||||
}
|
||||
CHECK(WaitForSingleObject(queue->GetErrorEvent(), 0) == WAIT_TIMEOUT);
|
||||
std::printf("batches=%d remaps=%d\n", batches, remaps);
|
||||
std::printf("stores: batches=%d remaps=%d\n", batches, remaps);
|
||||
CHECK(batches > 10 && remaps > 40);
|
||||
|
||||
// 2. zlib streams inflated into the window, through BetterXen's request interface.
|
||||
using namespace bx::storage;
|
||||
Com<Factory> synthetic;
|
||||
CHECK(DStorageGetFactory(factory_iid, synthetic.out()) == S_OK && synthetic.value);
|
||||
Com<Queue> zqueue;
|
||||
CHECK(synthetic->CreateQueue(64, queue_iid, zqueue.out()) == S_OK && zqueue.value);
|
||||
const std::vector<unsigned char> zstream = zlib_repeat(0x5A, kRequestBytes); // 1 + 1016 * 258 + 15 bytes
|
||||
CHECK(!zstream.empty() && zstream.size() < kRequestBytes);
|
||||
Request zrequest{nullptr, 0, zstream.data(), base, static_cast<DWORD>(zstream.size()), compression_zlib};
|
||||
zrequest.output_size = kRequestBytes;
|
||||
// Control: the stream inflates correctly with nothing remapped.
|
||||
zqueue->EnqueueRequest(&zrequest);
|
||||
zqueue->EnqueueSetEvent(done);
|
||||
zqueue->Submit();
|
||||
CHECK(WaitForSingleObject(done, 10000) == WAIT_OBJECT_0);
|
||||
ErrorRecord zcontrol{};
|
||||
zqueue->RetrieveErrorRecord(&zcontrol);
|
||||
std::printf("zlib control: failures=%llu hr=0x%08lx first=%02x last=%02x\n",
|
||||
static_cast<unsigned long long>(zcontrol.failure_count), static_cast<unsigned long>(zcontrol.first_error),
|
||||
base[0], base[kRequestBytes - 1]);
|
||||
CHECK(zcontrol.failure_count == 0 && base[0] == 0x5A && base[kPage + 7] == 0x5A && base[kRequestBytes - 1] == 0x5A);
|
||||
int zbatches = 0;
|
||||
const DWORD zstart = GetTickCount();
|
||||
while (GetTickCount() - zstart < 4000) {
|
||||
for (int i = 0; i < 4; ++i) zqueue->EnqueueRequest(&zrequest);
|
||||
zqueue->EnqueueSetEvent(done);
|
||||
zqueue->Submit();
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
CHECK(XMemMapPhysicalPages(base + kPage, 2, (remaps & 1) ? swap_b : swap_a) == base + kPage);
|
||||
++remaps;
|
||||
}
|
||||
CHECK(WaitForSingleObject(done, 10000) == WAIT_OBJECT_0);
|
||||
++zbatches;
|
||||
}
|
||||
ErrorRecord zerr{};
|
||||
zqueue->RetrieveErrorRecord(&zerr);
|
||||
std::printf("zlib under remap: batches=%d failures=%llu\n", zbatches, static_cast<unsigned long long>(zerr.failure_count));
|
||||
if (zerr.failure_count) std::printf("zlib first error hr=0x%08lx count=%llu\n", static_cast<unsigned long>(zerr.first_error), static_cast<unsigned long long>(zerr.failure_count));
|
||||
CHECK(zerr.failure_count == 0);
|
||||
CHECK(base[0] == 0x5A && base[kRequestBytes - 1] == 0x5A); // slots 0 and 3 keep their pages
|
||||
CHECK(zbatches > 10);
|
||||
|
||||
// 3. The window as the source: loads from title memory into private memory.
|
||||
std::vector<unsigned char> sink(kRequestBytes, 0);
|
||||
DSTORAGE_REQUEST load{};
|
||||
load.Options.SourceType = DSTORAGE_REQUEST_SOURCE_MEMORY;
|
||||
load.Options.DestinationType = DSTORAGE_REQUEST_DESTINATION_MEMORY;
|
||||
load.Source.Memory.Source = base;
|
||||
load.Source.Memory.Size = kRequestBytes;
|
||||
load.Destination.Memory.Buffer = sink.data();
|
||||
load.Destination.Memory.Size = kRequestBytes;
|
||||
int lbatches = 0;
|
||||
const DWORD lstart = GetTickCount();
|
||||
while (GetTickCount() - lstart < 2000) {
|
||||
for (int i = 0; i < 4; ++i) queue->EnqueueRequest(&load);
|
||||
queue->EnqueueSetEvent(done);
|
||||
queue->Submit();
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
CHECK(XMemMapPhysicalPages(base + kPage, 2, (remaps & 1) ? swap_b : swap_a) == base + kPage);
|
||||
++remaps;
|
||||
}
|
||||
CHECK(WaitForSingleObject(done, 10000) == WAIT_OBJECT_0);
|
||||
++lbatches;
|
||||
}
|
||||
CHECK(WaitForSingleObject(queue->GetErrorEvent(), 0) == WAIT_TIMEOUT);
|
||||
CHECK(sink[0] == 0x5A); // slot 0 still holds the inflated bytes
|
||||
std::printf("loads: batches=%d remaps=%d\n", lbatches, remaps);
|
||||
CHECK(lbatches > 10);
|
||||
CloseHandle(done);
|
||||
std::puts("test_xcrdapi_remap_guard: passed");
|
||||
return 0;
|
||||
|
||||
@@ -15,12 +15,14 @@ VOID WINAPI XMemFreeDefault(PVOID, uint64_t);
|
||||
PVOID WINAPI XMemVirtualAlloc(PVOID, SIZE_T, DWORD, uint64_t, DWORD);
|
||||
SIZE_T WINAPI XMemVirtualQuery(LPCVOID, PMEMORY_BASIC_INFORMATION, SIZE_T);
|
||||
BOOL WINAPI XMemTransferMemory(PVOID, LPCVOID, SIZE_T, uint64_t);
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(PVOID, SIZE_T);
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(DWORD, PVOID);
|
||||
BOOL WINAPI XMemIsToolsMemAvailable();
|
||||
}
|
||||
|
||||
/* XMEM_CPU from the authorized GDK documentation of XMemVirtualAlloc. */
|
||||
constexpr uint64_t kXMemCpu = 0x1;
|
||||
/* XMEM_WORKING_SET_TITLE from the authorized GDK header (test_xmem_working_set covers the rest). */
|
||||
constexpr DWORD kXMemWorkingSetTitle = 0x20000001;
|
||||
|
||||
#define CHECK(condition) \
|
||||
do { \
|
||||
@@ -38,7 +40,8 @@ int main() {
|
||||
const auto* config = bx_get_runtime_config();
|
||||
|
||||
bx_xmem_stats_t stats{};
|
||||
CHECK(config && XMemGetWorkingSetStatistics(&stats, sizeof(stats)));
|
||||
CHECK(config);
|
||||
bx_xmem_get_internal_stats(&stats);
|
||||
char profile[16]{};
|
||||
GetEnvironmentVariableA("BX_PROFILE", profile, sizeof(profile));
|
||||
const uint64_t expected_limit = std::strcmp(profile, "anaconda") == 0
|
||||
@@ -48,14 +51,22 @@ int main() {
|
||||
CHECK(stats.title_limit_bytes == config->title_memory_limit_bytes);
|
||||
CHECK(stats.committed_virtual_bytes == 0 && stats.allocated_physical_bytes == 0);
|
||||
CHECK(!XMemIsToolsMemAvailable());
|
||||
CHECK(!XMemGetWorkingSetStatistics(&stats, sizeof(stats) - 1));
|
||||
SetLastError(0);
|
||||
CHECK(!XMemGetWorkingSetStatistics(kXMemWorkingSetTitle, nullptr));
|
||||
CHECK(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
unsigned char large_stats[sizeof(bx_xmem_stats_t) + 16];
|
||||
std::memset(large_stats, 0xCC, sizeof(large_stats));
|
||||
CHECK(XMemGetWorkingSetStatistics(large_stats, sizeof(large_stats)));
|
||||
for (size_t i = sizeof(bx_xmem_stats_t); i < sizeof(large_stats); ++i) {
|
||||
CHECK(large_stats[i] == 0);
|
||||
// XMEM_WORKING_SET_STATISTICS is 120 bytes on x64; GameLimit is its first SIZE_T and GameUsed
|
||||
// its second. Nothing past the structure is written.
|
||||
alignas(8) unsigned char working_set[120 + 16];
|
||||
std::memset(working_set, 0xCC, sizeof(working_set));
|
||||
CHECK(XMemGetWorkingSetStatistics(kXMemWorkingSetTitle, working_set));
|
||||
uint64_t game_limit = 0;
|
||||
uint64_t game_used = 0;
|
||||
std::memcpy(&game_limit, working_set, sizeof(game_limit));
|
||||
std::memcpy(&game_used, working_set + 8, sizeof(game_used));
|
||||
CHECK(game_limit == stats.title_limit_bytes && game_used == 0);
|
||||
for (size_t i = 120; i < sizeof(working_set); ++i) {
|
||||
CHECK(working_set[i] == 0xCC);
|
||||
}
|
||||
|
||||
auto* ordinary = XMemAlloc(73, 0);
|
||||
|
||||
@@ -5,14 +5,36 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "bx_xmem_internal.h"
|
||||
|
||||
extern "C" {
|
||||
PVOID WINAPI XMemVirtualAlloc(PVOID, SIZE_T, DWORD, uint64_t, DWORD);
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(PVOID, SIZE_T);
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(DWORD, PVOID);
|
||||
}
|
||||
|
||||
namespace {
|
||||
// XMEM_WORKING_SET_TITLE, and the title fields of the 120-byte XMEM_WORKING_SET_STATISTICS on
|
||||
// x64 (authorized GDK header): GameLimit, GameUsed and GameUsedPeak are SIZE_Ts at these offsets.
|
||||
constexpr DWORD kXMemWorkingSetTitle = 0x20000001;
|
||||
|
||||
struct TitleUsage {
|
||||
uint64_t limit;
|
||||
uint64_t used;
|
||||
uint64_t peak;
|
||||
};
|
||||
|
||||
bool title_usage(TitleUsage& usage) {
|
||||
alignas(8) unsigned char statistics[120]{};
|
||||
if (!XMemGetWorkingSetStatistics(kXMemWorkingSetTitle, statistics)) return false;
|
||||
std::memcpy(&usage.limit, statistics + 0x00, sizeof(usage.limit));
|
||||
std::memcpy(&usage.used, statistics + 0x08, sizeof(usage.used));
|
||||
std::memcpy(&usage.peak, statistics + 0x58, sizeof(usage.peak));
|
||||
return true;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
#define CHECK(condition) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
@@ -28,24 +50,24 @@ int main() {
|
||||
GetSystemInfo(&sys);
|
||||
const SIZE_T page = sys.dwPageSize;
|
||||
|
||||
bx_xmem_stats_t stats{};
|
||||
CHECK(XMemGetWorkingSetStatistics(&stats, sizeof(stats)));
|
||||
const uint64_t used = stats.committed_virtual_bytes + stats.allocated_physical_bytes;
|
||||
CHECK(used < stats.title_limit_bytes);
|
||||
TitleUsage stats{};
|
||||
CHECK(title_usage(stats));
|
||||
const uint64_t used = stats.used;
|
||||
CHECK(used < stats.limit);
|
||||
// Only bookkeeping is charged; nothing of this size is allocated on the host.
|
||||
const uint64_t headroom = stats.title_limit_bytes - used;
|
||||
const uint64_t headroom = stats.limit - used;
|
||||
|
||||
// Graphics-first order: an external charge fills the cap...
|
||||
CHECK(bx_xmem_try_charge_external(headroom) == 1);
|
||||
CHECK(bx_xmem_try_charge_external(1) == 0);
|
||||
|
||||
// ...is visible in the reported usage, and peak never exceeds it...
|
||||
CHECK(XMemGetWorkingSetStatistics(&stats, sizeof(stats)));
|
||||
CHECK(stats.committed_virtual_bytes + stats.allocated_physical_bytes == stats.title_limit_bytes);
|
||||
CHECK(stats.peak_committed_bytes <= stats.title_limit_bytes);
|
||||
CHECK(title_usage(stats));
|
||||
CHECK(stats.used == stats.limit);
|
||||
CHECK(stats.peak <= stats.limit);
|
||||
bx_xmem_stats_t internal{};
|
||||
bx_xmem_get_internal_stats(&internal);
|
||||
CHECK(internal.committed_virtual_bytes == stats.committed_virtual_bytes);
|
||||
CHECK(internal.committed_virtual_bytes + internal.allocated_physical_bytes == stats.used);
|
||||
|
||||
// ...and a later XMem commit is refused against the same cap.
|
||||
SetLastError(0);
|
||||
@@ -55,13 +77,13 @@ int main() {
|
||||
// An over-release is refused and leaves the outstanding charge in place.
|
||||
bx_xmem_release_charge_external(headroom + 1);
|
||||
CHECK(bx_xmem_try_charge_external(1) == 0);
|
||||
CHECK(XMemGetWorkingSetStatistics(&stats, sizeof(stats)));
|
||||
CHECK(stats.committed_virtual_bytes + stats.allocated_physical_bytes == stats.title_limit_bytes);
|
||||
CHECK(title_usage(stats));
|
||||
CHECK(stats.used == stats.limit);
|
||||
|
||||
// Releasing the real charge admits the same XMem commit again.
|
||||
bx_xmem_release_charge_external(headroom);
|
||||
CHECK(XMemGetWorkingSetStatistics(&stats, sizeof(stats)));
|
||||
CHECK(stats.committed_virtual_bytes + stats.allocated_physical_bytes == used);
|
||||
CHECK(title_usage(stats));
|
||||
CHECK(stats.used == used);
|
||||
void* block = XMemVirtualAlloc(nullptr, page, MEM_COMMIT | MEM_RESERVE, 0x1 /* XMEM_CPU */, PAGE_READWRITE);
|
||||
CHECK(block != nullptr);
|
||||
CHECK(VirtualFree(block, 0, MEM_RELEASE));
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
*/
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "bx_xmem_internal.h"
|
||||
|
||||
@@ -21,7 +23,7 @@ BOOL WINAPI XMemAllocatePhysicalPages(uint64_t, PULONG_PTR, PULONG_PTR);
|
||||
BOOL WINAPI XMemFreePhysicalPages(ULONG_PTR, PULONG_PTR);
|
||||
PVOID WINAPI XMemMapPhysicalPages(PVOID, ULONG_PTR, PULONG_PTR);
|
||||
BOOL WINAPI XMemMapPhysicalPagesScatter(PVOID*, ULONG_PTR, PULONG_PTR);
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(PVOID, SIZE_T);
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(DWORD, PVOID);
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -37,6 +39,11 @@ constexpr uint64_t kXMemGraphics32BitAddress = 0x7;
|
||||
constexpr DWORD kMemReservePlaceholder = 0x40000;
|
||||
constexpr DWORD kMemReplacePlaceholder = 0x4000;
|
||||
constexpr DWORD kPageGraphicsReadWrite = 0x2000;
|
||||
// XMEM_WORKING_SET_TITLE; in the 120-byte XMEM_WORKING_SET_STATISTICS (x64),
|
||||
// GameAllocatedPhysicalPageCount is the UINT32 at byte 0x24.
|
||||
constexpr DWORD kXMemWorkingSetTitle = 0x20000001;
|
||||
constexpr size_t kWorkingSetSize = 120;
|
||||
constexpr size_t kGameAllocatedPhysicalPageCount = 0x24;
|
||||
|
||||
#define CHECK(condition) \
|
||||
do { \
|
||||
@@ -54,7 +61,7 @@ DWORD state_of(const void* address) {
|
||||
|
||||
bool check_physical_pages() {
|
||||
bx_xmem_stats_t stats{};
|
||||
CHECK(XMemGetWorkingSetStatistics(&stats, sizeof(stats)));
|
||||
bx_xmem_get_internal_stats(&stats);
|
||||
CHECK(stats.allocated_physical_bytes == 0);
|
||||
|
||||
// Flags outside 2 MB clusters and the bandwidth values are refused before anything changes.
|
||||
@@ -76,9 +83,11 @@ bool check_physical_pages() {
|
||||
CHECK((pages[0] >> 4) != (pages[1] >> 4) && (pages[1] >> 4) != (pages[2] >> 4) && (pages[2] >> 4) != (pages[3] >> 4));
|
||||
bx_xmem_get_internal_stats(&stats);
|
||||
CHECK(stats.allocated_physical_bytes == 4 * kPage);
|
||||
bx_xmem_stats_t ws_stats{};
|
||||
CHECK(XMemGetWorkingSetStatistics(&ws_stats, sizeof(ws_stats)));
|
||||
CHECK(ws_stats.allocated_physical_bytes == 4 * kPage);
|
||||
alignas(8) unsigned char working_set[kWorkingSetSize]{};
|
||||
CHECK(XMemGetWorkingSetStatistics(kXMemWorkingSetTitle, working_set));
|
||||
uint32_t working_set_pages = 0;
|
||||
std::memcpy(&working_set_pages, working_set + kGameAllocatedPhysicalPageCount, sizeof(working_set_pages));
|
||||
CHECK(working_set_pages == 4);
|
||||
|
||||
ULONG_PTR cap_pages = static_cast<ULONG_PTR>(stats.title_limit_bytes / kPage);
|
||||
CHECK(!XMemAllocatePhysicalPages(0, &cap_pages, pages));
|
||||
@@ -101,8 +110,11 @@ bool check_physical_pages() {
|
||||
ULONG_PTR reversed[] = {pages[3], pages[2], pages[1], pages[0]};
|
||||
CHECK(XMemMapPhysicalPages(base + 4 * kPage, 4, reversed) == base + 4 * kPage);
|
||||
CHECK(base[4 * kPage + 9] == 0x43 && base[7 * kPage + 9] == 0x40);
|
||||
base[5 * kPage + 1] = 0x7e;
|
||||
CHECK(base[2 * kPage + 1] == 0x7e);
|
||||
// Slots 2 and 5 now alias one physical page, which the compiler cannot know: write and read
|
||||
// through volatile, or the read may be scheduled before the write.
|
||||
volatile BYTE* const view = base;
|
||||
view[5 * kPage + 1] = 0x7e;
|
||||
CHECK(view[2 * kPage + 1] == 0x7e);
|
||||
|
||||
bx_xmem_region_info_t info{};
|
||||
CHECK(bx_xmem_query_region(reinterpret_cast<uintptr_t>(base + 4 * kPage + 3), &info));
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
add_executable(test_xmem_working_set main.cpp)
|
||||
target_include_directories(test_xmem_working_set PRIVATE "${BX_ABI_INCLUDE_DIR}")
|
||||
target_link_libraries(test_xmem_working_set PRIVATE xmem bx_runtime_veh kernel32)
|
||||
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
* XMemGetWorkingSetStatistics(WorkingSetFlags, Statistics), as the authorized GDK header declares
|
||||
* it: a DWORD of XMEM_WORKING_SET_* flags, then a pointer to the statistics structure.
|
||||
*
|
||||
* The flag values and the structure layout below are written out from that header for x64
|
||||
* (SIZE_T is 8 bytes, UINT32 is 4, fields in declaration order with natural alignment), not taken
|
||||
* from xmem.dll. Fields are read at these literal byte offsets, so a shim that lays the structure
|
||||
* out differently, or writes past it, fails here.
|
||||
*
|
||||
* What xmem.dll reports (BetterXen's inference, recorded in shims/xmem/xmem.cpp):
|
||||
* - GameLimit is the title memory cap, GameUsed everything the cap counts (XMem heap, virtual
|
||||
* commits, physical pages, external charges), GameUsedPeak the highest GameUsed, and
|
||||
* GameAllocatedPhysicalPageCount the 64 KiB physical pages allocated;
|
||||
* - tools memory is unavailable (XMemIsToolsMemAvailable is FALSE), so the tools fields are 0;
|
||||
* - the counters the host does not track (stack, GPU-optimal bandwidth, kernel pool,
|
||||
* DirectStorage, frame-preserve buffer, page tables) and the reserved words are 0;
|
||||
* - every field is written whichever flags are passed, and flags outside the five
|
||||
* XMEM_WORKING_SET_* values are refused.
|
||||
*/
|
||||
#include <windows.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "bx_log.h"
|
||||
#include "bx_xmem_internal.h"
|
||||
|
||||
extern "C" {
|
||||
BOOL WINAPI XMemGetWorkingSetStatistics(DWORD, PVOID);
|
||||
BOOL WINAPI XMemIsToolsMemAvailable();
|
||||
PVOID WINAPI XMemAllocDefault(SIZE_T, uint64_t);
|
||||
VOID WINAPI XMemFreeDefault(PVOID, uint64_t);
|
||||
PVOID WINAPI XMemVirtualAlloc(PVOID, SIZE_T, DWORD, uint64_t, DWORD);
|
||||
BOOL WINAPI XMemAllocatePhysicalPages(uint64_t, PULONG_PTR, PULONG_PTR);
|
||||
BOOL WINAPI XMemFreePhysicalPages(ULONG_PTR, PULONG_PTR);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
// XMEM_WORKING_SET_* flags.
|
||||
constexpr DWORD kTitle = 0x20000001;
|
||||
constexpr DWORD kTools = 0x20000002;
|
||||
constexpr DWORD kStack = 0x20000004;
|
||||
constexpr DWORD kKernelPool = 0x20000008;
|
||||
constexpr DWORD kCpuPte = 0x20000010;
|
||||
constexpr DWORD kAll = kTitle | kTools | kStack | kKernelPool | kCpuPte;
|
||||
|
||||
// XMEM_WORKING_SET_STATISTICS byte offsets on x64.
|
||||
constexpr size_t kGameLimit = 0x00; // SIZE_T
|
||||
constexpr size_t kGameUsed = 0x08; // SIZE_T
|
||||
constexpr size_t kToolsLimit = 0x10; // SIZE_T
|
||||
constexpr size_t kToolsUsed = 0x18; // SIZE_T
|
||||
constexpr size_t kStackUsed = 0x20; // UINT32
|
||||
constexpr size_t kGameAllocatedPhysicalPageCount = 0x24; // UINT32
|
||||
constexpr size_t kGpuOptimalBandwidthLimit = 0x28; // SIZE_T
|
||||
constexpr size_t kGpuOptimalBandwidthUsed = 0x30; // SIZE_T
|
||||
constexpr size_t kToolsGpuOptimalBandwidthLimit = 0x38; // SIZE_T
|
||||
constexpr size_t kToolsGpuOptimalBandwidthUsed = 0x40; // SIZE_T
|
||||
constexpr size_t kKernelPoolUsed = 0x48; // UINT32
|
||||
constexpr size_t kKernelPoolLimit = 0x4C; // UINT32
|
||||
constexpr size_t kDirectStorageUsed = 0x50; // UINT32
|
||||
constexpr size_t kFramePreserveBufferSize = 0x54; // UINT32
|
||||
constexpr size_t kGameUsedPeak = 0x58; // SIZE_T
|
||||
constexpr size_t kGpuPageTableSize = 0x60; // UINT32
|
||||
constexpr size_t kCpuPageTableSize = 0x64; // UINT32
|
||||
constexpr size_t kReserved0 = 0x68; // SIZE_T reserved1[0]
|
||||
constexpr size_t kReserved1 = 0x70; // SIZE_T reserved1[1]
|
||||
constexpr size_t kStatisticsSize = 0x78;
|
||||
|
||||
// XMEM_CPU (XMemVirtualAlloc) and the physical page size, from the same documentation.
|
||||
constexpr uint64_t kXMemCpu = 0x1;
|
||||
constexpr uint64_t kPhysicalPage = 64 * 1024;
|
||||
|
||||
constexpr unsigned char kFill = 0xCC;
|
||||
constexpr size_t kGuard = 32;
|
||||
|
||||
// The structure sits between two guard bands; the shim may write only the structure.
|
||||
struct Probe {
|
||||
alignas(16) unsigned char bytes[kGuard + kStatisticsSize + kGuard];
|
||||
|
||||
void fill() { std::memset(bytes, kFill, sizeof(bytes)); }
|
||||
void* statistics() { return bytes + kGuard; }
|
||||
uint64_t u64(size_t offset) const {
|
||||
uint64_t value;
|
||||
std::memcpy(&value, bytes + kGuard + offset, sizeof(value));
|
||||
return value;
|
||||
}
|
||||
uint32_t u32(size_t offset) const {
|
||||
uint32_t value;
|
||||
std::memcpy(&value, bytes + kGuard + offset, sizeof(value));
|
||||
return value;
|
||||
}
|
||||
bool guards_intact() const {
|
||||
for (size_t i = 0; i < kGuard; ++i) {
|
||||
if (bytes[i] != kFill || bytes[kGuard + kStatisticsSize + i] != kFill) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool untouched() const {
|
||||
for (unsigned char byte : bytes) {
|
||||
if (byte != kFill) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// Fields xmem.dll does not account for are written as zero, whatever the flags.
|
||||
bool untracked_fields_zero() const {
|
||||
return u64(kToolsLimit) == 0 && u64(kToolsUsed) == 0 && u32(kStackUsed) == 0
|
||||
&& u64(kGpuOptimalBandwidthLimit) == 0 && u64(kGpuOptimalBandwidthUsed) == 0
|
||||
&& u64(kToolsGpuOptimalBandwidthLimit) == 0 && u64(kToolsGpuOptimalBandwidthUsed) == 0
|
||||
&& u32(kKernelPoolUsed) == 0 && u32(kKernelPoolLimit) == 0 && u32(kDirectStorageUsed) == 0
|
||||
&& u32(kFramePreserveBufferSize) == 0 && u32(kGpuPageTableSize) == 0
|
||||
&& u32(kCpuPageTableSize) == 0 && u64(kReserved0) == 0 && u64(kReserved1) == 0;
|
||||
}
|
||||
};
|
||||
|
||||
// A shim that reads the flags as an address writes through them. Report that as a failure
|
||||
// instead of an unexplained crash; the handler acts only while the export is running.
|
||||
volatile LONG g_in_call = 0;
|
||||
|
||||
LONG CALLBACK fault_in_call(EXCEPTION_POINTERS* info) {
|
||||
if (g_in_call && info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
|
||||
std::fprintf(stderr, "FAIL: test_xmem_working_set: access violation inside "
|
||||
"XMemGetWorkingSetStatistics (write=%llu address=0x%llx)\n",
|
||||
static_cast<unsigned long long>(info->ExceptionRecord->ExceptionInformation[0]),
|
||||
static_cast<unsigned long long>(info->ExceptionRecord->ExceptionInformation[1]));
|
||||
std::fflush(stderr);
|
||||
ExitProcess(1);
|
||||
}
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
BOOL get_statistics(DWORD flags, void* statistics) {
|
||||
InterlockedExchange(&g_in_call, 1);
|
||||
const BOOL ok = XMemGetWorkingSetStatistics(flags, statistics);
|
||||
InterlockedExchange(&g_in_call, 0);
|
||||
return ok;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#define CHECK(condition) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
std::fprintf(stderr, "xmem working set:%d: %s (Win32 error %lu)\n", \
|
||||
__LINE__, #condition, static_cast<unsigned long>(GetLastError())); \
|
||||
return 1; \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
int main() {
|
||||
CHECK(AddVectoredExceptionHandler(1, fault_in_call) != nullptr);
|
||||
SYSTEM_INFO sys{};
|
||||
GetSystemInfo(&sys);
|
||||
const SIZE_T page = sys.dwPageSize;
|
||||
const auto* config = bx_get_runtime_config();
|
||||
CHECK(config && config->title_memory_limit_bytes != 0);
|
||||
const uint64_t limit = config->title_memory_limit_bytes;
|
||||
|
||||
Probe probe{};
|
||||
|
||||
// The shape a tools-memory path uses: tools and kernel pool, no title bit.
|
||||
probe.fill();
|
||||
SetLastError(0);
|
||||
CHECK(get_statistics(kTools | kKernelPool, probe.statistics()));
|
||||
CHECK(probe.guards_intact());
|
||||
CHECK(probe.untracked_fields_zero());
|
||||
CHECK(!XMemIsToolsMemAvailable());
|
||||
CHECK(probe.u64(kGameLimit) == limit);
|
||||
|
||||
// Title usage at start.
|
||||
probe.fill();
|
||||
CHECK(get_statistics(kTitle, probe.statistics()));
|
||||
CHECK(probe.guards_intact());
|
||||
CHECK(probe.untracked_fields_zero());
|
||||
CHECK(probe.u64(kGameLimit) == limit);
|
||||
const uint64_t used0 = probe.u64(kGameUsed);
|
||||
const uint32_t pages0 = probe.u32(kGameAllocatedPhysicalPageCount);
|
||||
const uint64_t peak0 = probe.u64(kGameUsedPeak);
|
||||
CHECK(used0 < limit && peak0 >= used0);
|
||||
CHECK(uint64_t{pages0} * kPhysicalPage <= used0);
|
||||
|
||||
// Every kind of charge counts in GameUsed: XMem heap, a virtual commit, two physical
|
||||
// pages and an external charge made on behalf of another DLL.
|
||||
void* heap = XMemAllocDefault(4096, 0);
|
||||
CHECK(heap != nullptr);
|
||||
void* block = XMemVirtualAlloc(nullptr, 3 * page, MEM_COMMIT | MEM_RESERVE, kXMemCpu, PAGE_READWRITE);
|
||||
CHECK(block != nullptr);
|
||||
ULONG_PTR count = 2;
|
||||
ULONG_PTR physical[2]{};
|
||||
CHECK(XMemAllocatePhysicalPages(0, &count, physical) && count == 2);
|
||||
constexpr uint64_t external = 1 << 20;
|
||||
CHECK(bx_xmem_try_charge_external(external) == 1);
|
||||
const uint64_t expected_used = used0 + 4096 + 3 * page + 2 * kPhysicalPage + external;
|
||||
|
||||
probe.fill();
|
||||
CHECK(get_statistics(kTitle, probe.statistics()));
|
||||
CHECK(probe.guards_intact());
|
||||
CHECK(probe.untracked_fields_zero());
|
||||
CHECK(probe.u64(kGameLimit) == limit);
|
||||
CHECK(probe.u64(kGameUsed) == expected_used);
|
||||
CHECK(probe.u32(kGameAllocatedPhysicalPageCount) == pages0 + 2);
|
||||
const uint64_t peak1 = probe.u64(kGameUsedPeak);
|
||||
CHECK(peak1 >= expected_used && peak1 >= peak0);
|
||||
|
||||
// XMEM_WORKING_SET_ALL reports the same title figures.
|
||||
probe.fill();
|
||||
CHECK(get_statistics(kAll, probe.statistics()));
|
||||
CHECK(probe.guards_intact());
|
||||
CHECK(probe.untracked_fields_zero());
|
||||
CHECK(probe.u64(kGameUsed) == expected_used);
|
||||
CHECK(probe.u32(kGameAllocatedPhysicalPageCount) == pages0 + 2);
|
||||
|
||||
// Releasing everything returns GameUsed to where it started; the peak stays.
|
||||
bx_xmem_release_charge_external(external);
|
||||
CHECK(XMemFreePhysicalPages(2, physical));
|
||||
CHECK(VirtualFree(block, 0, MEM_RELEASE));
|
||||
XMemFreeDefault(heap, 0);
|
||||
probe.fill();
|
||||
CHECK(get_statistics(kTitle, probe.statistics()));
|
||||
CHECK(probe.guards_intact());
|
||||
CHECK(probe.u64(kGameUsed) == used0);
|
||||
CHECK(probe.u32(kGameAllocatedPhysicalPageCount) == pages0);
|
||||
CHECK(probe.u64(kGameUsedPeak) == peak1);
|
||||
|
||||
// A NULL structure, or flags outside the five XMEM_WORKING_SET_* values, is refused and
|
||||
// nothing is written.
|
||||
SetLastError(0);
|
||||
CHECK(!get_statistics(kTitle, nullptr));
|
||||
CHECK(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
const DWORD bad_flags[] = {0, 0x1, 0x20000000, 0x20000020, kTitle | 0x100};
|
||||
for (DWORD flags : bad_flags) {
|
||||
probe.fill();
|
||||
SetLastError(0);
|
||||
CHECK(!get_statistics(flags, probe.statistics()));
|
||||
CHECK(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
CHECK(probe.untouched());
|
||||
}
|
||||
|
||||
std::printf("PASS: test_xmem_working_set\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user