A host that refuses the title's slots plus 2^18 dynamic ones (NVIDIA's
1,000,000-view cap) now gets 2^16 dynamic slots, as before, instead of
losing mirrored title slots to the larger range: at the cap, 2^18 left
737,856 title slots against 934,464, and titles were seen to index slots
up to 917,140. The cap itself is unchanged. Hosts that take the larger
heap (RX 9070 XT) keep 2^18.
They went through a 32-bit conversion, so an f16 past the i16 range
(32768 up to 65504) wrapped, and infinities and NaN were undefined. The
value is now clamped in f32 to the 16-bit range first (every f16 is exact
there) and NaN gives 0, as the hardware's conversions do.
exp mrtz's channel y is lowered to an SV_StencilRef output, but the
module's shader flags never had StencilRef (bit 11) and SFI0 never had
D3D_SHADER_FEATURE_STENCIL_REF (0x200). DXC sets both for a pixel
shader whose output signature has the stencil reference, and the
validator checks the flags against the module.
Both are now set when a pixel shader outputs SV_StencilRef.
The pipeline state validation part left PSInfo.SampleFrequency at 0.
DXC sets it when a pixel input is interpolated per sample (modes 6 and
7, which our lowering gives to PERSP_SAMPLE and LINEAR_SAMPLE
barycentrics) or is SV_SampleIndex, and the validator compares the
whole runtime info with what it derives from the module.
The flag is now set for such pixel shaders.
The f16 source (with abs/neg) is clamped to [-1, 1] or [0, 1], scaled by
32767 or 65535 and rounded to nearest even once from the exact product;
NaN gives 0. The product is formed in integers from the f16's bits,
because in f32 it has up to 26 significant bits and would round first.
Frame dumps decoded DXGI format 11 (R16G16B16A16_UNORM) as half floats,
so 0x8000 came out as -0 and 0xffff as -inf, and 12-14 were not handled.
Format 89 (R10G10B10_XR_BIAS_A2_UNORM) went through the B8G8R8A8 swap.
XPersistentLocalStorageGetPath documents E_FAIL for a pathSize smaller
than the path on Xbox devices; ERROR_INSUFFICIENT_BUFFER is the PC
result, which put_string gave us.
When HostHeap::dynamic ran out, State::tables skipped the fresh table and
the stage's user data fell back to the title's table offset. Constant
buffer tables are always made fresh and never mirrored, so the shader read
whatever host descriptor sat at those slots as a constant buffer; on AMD a
texture or null descriptor read as a buffer gives a wild base address and
the device is removed (#59: faults at 0x7000037xxxxx, 0x8000037xxxxx,
0x33c4000, a different pipeline every run, about 60 s in).
bind now reports that a table could not be made, and the draw, mesh
dispatch, dispatch or indirect execution is dropped. The dynamic range grows
from 2^16 to 2^18 slots, which the world did not exhaust on an RX 9070 XT.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
RtlVirtualUnwind and RtlCaptureContext want a 16-byte aligned CONTEXT,
and windows-sys 0.61 declares the x64 CONTEXT without align(16). In a
debug build the by-value copy in unwind_into, and the test's stack
context, landed 8 bytes off (an address ending in ...838), so
unwinds_like_the_system_walk crashed the whole victory-loader test binary
with a stack-overflow message and STATUS_ACCESS_VIOLATION. Aligning only
the test's context was not enough: the copy in unwind_into, which the
crash handler and stacks.rs also unwind with, faulted as well.
unwind_into now copies its context into an Aligned16 wrapper and unwinds
that; the test captures into one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Typed buffer loads in the 10_11_11, 11_11_10 and 10_10_10_2 families
(GFX10 unified formats 30-49) were refused, failing the shader. Fill in
their channel layouts and decode the unsigned 11- and 10-bit floats by
shifting them into half position for legacyF16ToF32, which is exact for
denormals, infinities and NaNs. Format numbers from LLVM's UfmtGFX10,
channel order from Mesa's ac_formats.c.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reading and loading a title DLL report its path when they fail;
preparing it, in between, did not. A DLL the PE parser refuses ended
the run with just "malformed image: ..." (or the like), without saying
which of the title's DLLs it was.
The prepare step now adds "preparing <path>" like its neighbours.
The device answers QueryInterface for ID3D12Device and for its newer
levels (Grand Theft Auto VI creates it as ID3D12Device11). A device
child's GetDevice and the DXGI device's QueryInterface knew only the
first: asked for the device by the interface the title holds, they
answered E_NOINTERFACE with a null pointer.
Both now ask the device's own test (is_device).
Co-Authored-By: Claude Fable 5.2 <[email protected]>
f32_to_half rounds to nearest by adding half an ulp to the mantissa,
then or-ed the shifted mantissa into the exponent field. When the
rounding carried out of the mantissa, that carry is the exponent's low
bit: or-ed into an odd exponent it was lost, so values just below a
power of two came out at the power below (2 - 2^-12 gave 1.0, not 2.0).
Rectangle lists use it for the fourth corner of half-float elements.
The carry is now added into the exponent.
The SOPP table had s_ttracedata_imm at 0x26, as Mesa's opcode list
does; RDNA2 encodes it at 0x28 (AMD's RDNA2 ISA, LLVM's GFX10 tables
and disassembler tests). A shader with the thread-trace marker decoded
it as an unknown opcode and failed to translate, though the IR drops
the marker as harmless.