fix: default viewport and scissor for translated draws #1650

Merged
tedin7 merged 6 commits from upstream-pr/1657 into main 2026-11-24 17:09:20 +00:00
tedin7 commented 2026-11-24 16:31:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T16:31:48Z.


What

A command list that never calls RSSetViewports (list slot 21) or RSSetScissorRects (slot 22) draws no pixel on desktop D3D12, yet every translated draw is counted as drawn. Pass now remembers whether the title set each one. A translated draw with no viewport covers the first render target (width, height, depth 0 to 1); with no scissor it gets the same rectangle. A viewport or scissor the title set is never replaced.

  • Title-neutral: applies only when the list did not set the state.
  • The two flags are the last members of Pass, cleared on Close (existing Pass reset) and on Reset.
  • A call with count 0 (or one that is not forwarded) leaves the state not set.
  • A draw with no render target 0 (depth only) gets no default. A render target view of a later mip uses the width and height of mip 0 of the resource; scissor and viewport then exceed the view, which only widens what the title's own pipeline can write to the bound view.

Tests

New startup_stream_viewport_warp and startup_stream_viewport_hardware reuse the startup_stream_consumer fixture (mode chosen by X2W_TEST_VIEWPORT) on an 8x4 target cleared to blue, red pixel shader:

  • none: no slot 21 or 22 -> all 32 pixels red (before: all blue).
  • rect: 4x2 viewport and scissor at (2, 1) -> red inside, blue outside.
  • reset: the rectangle on one list, then Reset of the same list with no slot 21 or 22 -> all 32 pixels red.

Failure message names the first wrong pixel. A mutation that disables the default fails none at pixel (0, 0); one that overrides the title's rectangle fails rect at pixel (2, 1); one that keeps the flags across Reset fails reset at pixel (0, 0). The disable-default-viewport mutation was run on Windows 2025 (see Verification).

Windows 2025 command: ctest --preset dev --no-tests=error -R '^startup_stream_viewport_(warp|hardware)$' -V

Run locally

  • x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only on tests/startup_stream_setup.cpp and tests/startup_stream_draw.cpp: clean.
  • Same on src/startup_stubs/d3d12_xs_device.cpp (includes the draw code): only the pre-existing __try/__except errors of MinGW in local_log.h, none on the changed lines.
  • tests/docs_links_check.py, tests/bidi_controls_check.py, git diff --check: pass.
  • Python syntax of the new check parsed.

Verification (Windows Server 2025, build 26100, MSVC 14.44, D3D12 WARP)

At 22989d61 (same tree as 50aaa702):

  • x2w_pipe.py preflight /root/wt/x2w-frontier-p04-viewport: no FAIL. It flagged the identifier small (Windows SDK macro) in tests/startup_stream_setup.cpp; renamed to inset in 50aaa702.
  • x2w_pipe.py win2025 1657 --regex '^(startup_stream_viewport_warp|startup_stream_draw_warp|startup_stubs|d3d12x_graphics_list_warp|startup_cb_blend_warp|stream_root_srv_warp)$' --force:
    • Debug (--preset dev): 6/6 passed.
    • Release /O2 (--preset release): 6/6 passed.
  • Mutation: with the default viewport block disabled (if (false && !pass.viewport_set)), startup_stream_viewport_warp failed on Windows 2025: none: pixel (0, 0) is 0000ffff, expected ff0000ff. The mutation commit was reverted (1f24626b, 22989d61).
  • The _hardware variant skips: the node has only WARP.

Open PR overlap

git merge-tree against the heads of #1441, #1469, #1511, #1549, #1555, #1567, #1641 and #1654: no new conflict. The existing conflicts of #1441 and #1469 (CMakeLists.txt, xg_xs.cpp) and #1549 (docs/experiments.md) already exist against main without this change. #1654 also edits tests/startup_stream_setup.cpp and docs/startup-runtime.md; it merges cleanly.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6586578351 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1657). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T16:31:48Z. --- ## What A command list that never calls RSSetViewports (list slot 21) or RSSetScissorRects (slot 22) draws no pixel on desktop D3D12, yet every translated draw is counted as drawn. Pass now remembers whether the title set each one. A translated draw with no viewport covers the first render target (width, height, depth 0 to 1); with no scissor it gets the same rectangle. A viewport or scissor the title set is never replaced. - Title-neutral: applies only when the list did not set the state. - The two flags are the last members of Pass, cleared on Close (existing Pass reset) and on Reset. - A call with count 0 (or one that is not forwarded) leaves the state not set. - A draw with no render target 0 (depth only) gets no default. A render target view of a later mip uses the width and height of mip 0 of the resource; scissor and viewport then exceed the view, which only widens what the title's own pipeline can write to the bound view. ## Tests New `startup_stream_viewport_warp` and `startup_stream_viewport_hardware` reuse the `startup_stream_consumer` fixture (mode chosen by X2W_TEST_VIEWPORT) on an 8x4 target cleared to blue, red pixel shader: - none: no slot 21 or 22 -> all 32 pixels red (before: all blue). - rect: 4x2 viewport and scissor at (2, 1) -> red inside, blue outside. - reset: the rectangle on one list, then Reset of the same list with no slot 21 or 22 -> all 32 pixels red. Failure message names the first wrong pixel. A mutation that disables the default fails `none` at pixel (0, 0); one that overrides the title's rectangle fails `rect` at pixel (2, 1); one that keeps the flags across Reset fails `reset` at pixel (0, 0). The disable-default-viewport mutation was run on Windows 2025 (see Verification). Windows 2025 command: `ctest --preset dev --no-tests=error -R '^startup_stream_viewport_(warp|hardware)$' -V` ## Run locally - `x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only` on tests/startup_stream_setup.cpp and tests/startup_stream_draw.cpp: clean. - Same on src/startup_stubs/d3d12_xs_device.cpp (includes the draw code): only the pre-existing __try/__except errors of MinGW in local_log.h, none on the changed lines. - tests/docs_links_check.py, tests/bidi_controls_check.py, git diff --check: pass. - Python syntax of the new check parsed. ## Verification (Windows Server 2025, build 26100, MSVC 14.44, D3D12 WARP) At 22989d61 (same tree as 50aaa702): - `x2w_pipe.py preflight /root/wt/x2w-frontier-p04-viewport`: no FAIL. It flagged the identifier `small` (Windows SDK macro) in tests/startup_stream_setup.cpp; renamed to `inset` in 50aaa702. - `x2w_pipe.py win2025 1657 --regex '^(startup_stream_viewport_warp|startup_stream_draw_warp|startup_stubs|d3d12x_graphics_list_warp|startup_cb_blend_warp|stream_root_srv_warp)$' --force`: - Debug (`--preset dev`): 6/6 passed. - Release `/O2` (`--preset release`): 6/6 passed. - Mutation: with the default viewport block disabled (`if (false && !pass.viewport_set)`), `startup_stream_viewport_warp` failed on Windows 2025: `none: pixel (0, 0) is 0000ffff, expected ff0000ff`. The mutation commit was reverted (1f24626b, 22989d61). - The `_hardware` variant skips: the node has only WARP. ## Open PR overlap `git merge-tree` against the heads of #1441, #1469, #1511, #1549, #1555, #1567, #1641 and #1654: no new conflict. The existing conflicts of #1441 and #1469 (CMakeLists.txt, xg_xs.cpp) and #1549 (docs/experiments.md) already exist against main without this change. #1654 also edits tests/startup_stream_setup.cpp and docs/startup-runtime.md; it merges cleanly. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 17:01:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T16:50:13Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22989d61c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6043593355 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1657#pullrequestreview-6043593355). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T16:50:13Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `22989d61c8` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-24 17:01:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T17:00:58Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6043761718 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1657#pullrequestreview-6043761718). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T17:00:58Z. **Review:** COMMENTED --- _No description provided._
chatgpt-codex-connector[bot commented 2026-11-24 17:02:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T16:45:45Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T16:50:16.475428Z 22989d6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7138167333 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1657#issuecomment-7138167333). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T16:45:45Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"22989d61c8691f46fc4347cc69c8f835d9856baa","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T16:50:16.475428Z">2026-11-24T16:50:16.475428Z</relative-time> | `22989d6` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-24 17:02:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T16:50:14Z.

Code review location: src/startup_stubs/d3d12_draw.inl; line 1063

@@ -1054,6 +1054,20 @@ bool draw_translated(Wrapper* self, bool indexed, UINT count, UINT instances, UI
             : ud.kind == Translation::root_constant ? ((ud.a >= 0 && ud.a < 16 && ud.b >= 0 && ud.b < 8) ? pass.constants[ud.a][ud.b] : 0)
             : ud.kind == Translation::stride && ud.a >= 0 && ud.a < 32 ? strides[ud.a] : 0;
     }
+    // A desktop list with no viewport or scissor draws nothing: cover the first render target unless the title set its own.
+    if (pass.target0 && (!pass.viewport_set || !pass.scissor_set)) {
+        const D3D12_RESOURCE_DESC target = pass.target0->GetDesc();
+        if (!pass.viewport_set) {
+            const D3D12_VIEWPORT full{0.0f, 0.0f, static_cast<float>(target.Width), static_cast<float>(target.Height), 0.0f, 1.0f};
+            list->RSSetViewports(1, &full);
+            pass.viewport_set = true;

P2 Badge Regenerate defaults when render target 0 changes

When a single command-list recording draws to differently sized targets without title viewport/scissor calls, the first fallback sets both *_set flags. list_targets() subsequently replaces pass.target0 without clearing those flags, so later draws never recalculate either default. For example, drawing to an 8×4 target and then a 32×16 target leaves the second draw using an 8×4 viewport and scissor, changing its viewport transform and leaving most pixels untouched. Keep title-supplied state distinct from automatically generated state, and refresh only the automatic defaults when the target changes.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4683445246 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1657#discussion_r4683445246). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T16:50:14Z. **Code review location:** `src/startup_stubs/d3d12_draw.inl`; line 1063 ~~~~diff @@ -1054,6 +1054,20 @@ bool draw_translated(Wrapper* self, bool indexed, UINT count, UINT instances, UI : ud.kind == Translation::root_constant ? ((ud.a >= 0 && ud.a < 16 && ud.b >= 0 && ud.b < 8) ? pass.constants[ud.a][ud.b] : 0) : ud.kind == Translation::stride && ud.a >= 0 && ud.a < 32 ? strides[ud.a] : 0; } + // A desktop list with no viewport or scissor draws nothing: cover the first render target unless the title set its own. + if (pass.target0 && (!pass.viewport_set || !pass.scissor_set)) { + const D3D12_RESOURCE_DESC target = pass.target0->GetDesc(); + if (!pass.viewport_set) { + const D3D12_VIEWPORT full{0.0f, 0.0f, static_cast<float>(target.Width), static_cast<float>(target.Height), 0.0f, 1.0f}; + list->RSSetViewports(1, &full); + pass.viewport_set = true; ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Regenerate defaults when render target 0 changes** When a single command-list recording draws to differently sized targets without title viewport/scissor calls, the first fallback sets both `*_set` flags. `list_targets()` subsequently replaces `pass.target0` without clearing those flags, so later draws never recalculate either default. For example, drawing to an 8×4 target and then a 32×16 target leaves the second draw using an 8×4 viewport and scissor, changing its viewport transform and leaving most pixels untouched. Keep title-supplied state distinct from automatically generated state, and refresh only the automatic defaults when the target changes. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-24 17:02:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T17:00:58Z.

Code review location: src/startup_stubs/d3d12_draw.inl; line 1063

@@ -1054,6 +1054,20 @@ bool draw_translated(Wrapper* self, bool indexed, UINT count, UINT instances, UI
             : ud.kind == Translation::root_constant ? ((ud.a >= 0 && ud.a < 16 && ud.b >= 0 && ud.b < 8) ? pass.constants[ud.a][ud.b] : 0)
             : ud.kind == Translation::stride && ud.a >= 0 && ud.a < 32 ? strides[ud.a] : 0;
     }
+    // A desktop list with no viewport or scissor draws nothing: cover the first render target unless the title set its own.
+    if (pass.target0 && (!pass.viewport_set || !pass.scissor_set)) {
+        const D3D12_RESOURCE_DESC target = pass.target0->GetDesc();
+        if (!pass.viewport_set) {
+            const D3D12_VIEWPORT full{0.0f, 0.0f, static_cast<float>(target.Width), static_cast<float>(target.Height), 0.0f, 1.0f};
+            list->RSSetViewports(1, &full);
+            pass.viewport_set = true;

Fixed in 3e895d2398 (logic in 07f2464f). The default viewport/scissor no longer sets the title flags. The size of the default already forwarded is tracked separately and regenerated when render target 0 changes. It is cleared on Reset/Close. New grow case in startup_stream_viewport draws on 8x4 then 16x8 in one list with no slot 21/22 calls. Win2025 Debug and Release /O2 passed: startup_stubs, startup_stream_viewport_warp, startup_stream_draw_warp. Also ran preflight, docs_links_check, bidi_controls_check, git diff --check. AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4683588427 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1657#discussion_r4683588427). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T17:00:58Z. **Code review location:** `src/startup_stubs/d3d12_draw.inl`; line 1063 ~~~~diff @@ -1054,6 +1054,20 @@ bool draw_translated(Wrapper* self, bool indexed, UINT count, UINT instances, UI : ud.kind == Translation::root_constant ? ((ud.a >= 0 && ud.a < 16 && ud.b >= 0 && ud.b < 8) ? pass.constants[ud.a][ud.b] : 0) : ud.kind == Translation::stride && ud.a >= 0 && ud.a < 32 ? strides[ud.a] : 0; } + // A desktop list with no viewport or scissor draws nothing: cover the first render target unless the title set its own. + if (pass.target0 && (!pass.viewport_set || !pass.scissor_set)) { + const D3D12_RESOURCE_DESC target = pass.target0->GetDesc(); + if (!pass.viewport_set) { + const D3D12_VIEWPORT full{0.0f, 0.0f, static_cast<float>(target.Width), static_cast<float>(target.Height), 0.0f, 1.0f}; + list->RSSetViewports(1, &full); + pass.viewport_set = true; ~~~~ --- Fixed in 3e895d2398095ceb73ab9f79c2f72cc7502151fd (logic in 07f2464f). The default viewport/scissor no longer sets the title flags. The size of the default already forwarded is tracked separately and regenerated when render target 0 changes. It is cleared on Reset/Close. New `grow` case in `startup_stream_viewport` draws on 8x4 then 16x8 in one list with no slot 21/22 calls. Win2025 Debug and Release /O2 passed: startup_stubs, startup_stream_viewport_warp, startup_stream_draw_warp. Also ran preflight, docs_links_check, bidi_controls_check, git diff --check. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 18:02:21 +00:00
ChazY11 commented 2026-11-24 18:02:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T17:16:20Z.


Two ways to overwrite a title-set viewport both survive the fixture

Reviewed 3e895d23. Built at that head, ran the two viewport cases, then mutated the new default in d3d12_draw.inl and rebuilt d3d12_xs_shim (the DLL the consumer loads — the timestamp changed each time, and the untouched build passes 2 of 2).

Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100.

cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R '^startup_stream_viewport' -V
warp     viewport none: all 32 pixels exact
warp     viewport rect: all 32 pixels exact
warp     viewport reset: all 32 pixels exact
warp     viewport grow: all 128 pixels exact
hardware ... same four, all exact

Mutations

change result
viewport width/height swapped in the default rect caught
the scissor branch disabled (if (false)) caught
viewport branch condition if (true) (always re-issue the default) not caught
scissor branch condition if (true) not caught

Why I am not calling the last two a gap outright

tests/startup_stream_viewport_check.py says the draw "never replaces one the title set", and the rect case is the one that would show it: a 4x2 viewport at (2,1) has to leave the outside pixels blue. With if (true) that expectation should break, and it does not — so in this fixture's ordering the title's own slot-21 call must land after whatever the shim does at submission time, and the overwrite is invisible.

That leaves two readings I cannot separate from the fixture:

  1. the mutant is equivalent for this call order, and a title that sets a viewport once and draws twice would still be safe;
  2. the overwrite is real, and the case that would expose it — set a viewport on draw 1, draw again on draw 2 without re-setting it — is simply not in the fixture.

The way to tell them apart is one more case, and it is small: in grow, draw twice on the first target with the rectangle set once before the first draw, and require red inside the rectangle and blue outside on both. If the second readback is all red, reading 2 is the answer.

I would rather flag this than stay quiet, because the branch's own comment says "Only the title's own calls set the flags; an automatic default is regenerated when render target 0 changes size" — the size cache is what makes the two if (true) mutants indistinguishable, and nothing asserts the cache does its job. Dropping the size comparison entirely (leaving !pass.viewport_set) also survives.

What is solid in the change

The swap and the disabled-scissor mutants being caught means the default rectangle is asserted in both extents and both views, and the reset case proves the default is not inherited across Reset.

Verdict

Reviewed 3e895d23. The default itself is correct and covered; the "never replaces what the title set" half of the contract is not, on the evidence of two surviving mutants. If you want the extra case I can write it against your branch or as a follow-up with Refs #1657 — your call.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7138944730 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1657#issuecomment-7138944730). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T17:16:20Z. --- ## Two ways to overwrite a title-set viewport both survive the fixture Reviewed `3e895d23`. Built at that head, ran the two viewport cases, then mutated the new default in `d3d12_draw.inl` and rebuilt `d3d12_xs_shim` (the DLL the consumer loads — the timestamp changed each time, and the untouched build passes 2 of 2). Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100. ```powershell cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R '^startup_stream_viewport' -V ``` ```text warp viewport none: all 32 pixels exact warp viewport rect: all 32 pixels exact warp viewport reset: all 32 pixels exact warp viewport grow: all 128 pixels exact hardware ... same four, all exact ``` ### Mutations | change | result | |---|---| | viewport width/height swapped in the default rect | **caught** | | the scissor branch disabled (`if (false)`) | **caught** | | viewport branch condition `if (true)` (always re-issue the default) | **not caught** | | scissor branch condition `if (true)` | **not caught** | ### Why I am not calling the last two a gap outright `tests/startup_stream_viewport_check.py` says the draw "never replaces one the title set", and the `rect` case is the one that would show it: a 4x2 viewport at (2,1) has to leave the outside pixels blue. With `if (true)` that expectation should break, and it does not — so in this fixture's ordering the title's own slot-21 call must land after whatever the shim does at submission time, and the overwrite is invisible. That leaves two readings I cannot separate from the fixture: 1. the mutant is equivalent *for this call order*, and a title that sets a viewport once and draws twice would still be safe; 2. the overwrite is real, and the case that would expose it — set a viewport on draw 1, draw again on draw 2 without re-setting it — is simply not in the fixture. The way to tell them apart is one more case, and it is small: in `grow`, draw twice on the first target with the rectangle set once before the first draw, and require red inside the rectangle and blue outside on **both**. If the second readback is all red, reading 2 is the answer. I would rather flag this than stay quiet, because the branch's own comment says "Only the title's own calls set the flags; an automatic default is regenerated when render target 0 changes size" — the size cache is what makes the two `if (true)` mutants indistinguishable, and nothing asserts the cache does its job. Dropping the size comparison entirely (leaving `!pass.viewport_set`) also survives. ### What is solid in the change The swap and the disabled-scissor mutants being caught means the default rectangle is asserted in both extents and both views, and the `reset` case proves the default is not inherited across `Reset`. ### Verdict Reviewed `3e895d23`. The default itself is correct and covered; the "never replaces what the title set" half of the contract is not, on the evidence of two surviving mutants. If you want the extra case I can write it against your branch or as a follow-up with `Refs #1657` — your call.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1650
No description provided.