Nugget
Loading...
Searching...
No Matches
tests
gpu-raster-phase21
raster-expected-phase21.h
Go to the documentation of this file.
1
/*
2
3
MIT License
4
5
Copyright (c) 2026 PCSX-Redux authors
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy
8
of this software and associated documentation files (the "Software"), to deal
9
in the Software without restriction, including without limitation the rights
10
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the Software is
12
furnished to do so, subject to the following conditions:
13
14
The above copyright notice and this permission notice shall be included in all
15
copies or substantial portions of the Software.
16
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
SOFTWARE.
24
25
*/
26
27
#pragma once
28
29
// Phase-21 expected values.
30
//
31
// Every probe samples the fixture texel(u,v) = (u+v)&0xff through CLUT8,
32
// so the expectation for a sample at primitive-offset k from base UV b is
33
// always expectedClut8Color((b + k) & 0xff) - the assertions compute that
34
// inline rather than hard-coding constants, because the whole point of the
35
// test is the `& 0xff`: in-range offsets are the control, offsets >= 256
36
// are the wrap.
37
//
38
// HARDWARE TRUTH (to confirm against silicon OBS on first run):
39
// The PS1 texel-fetch U/V coordinate is 8-bit, so an oversized primitive's
40
// per-pixel coordinate counter wraps mod 256 - the texture tiles. This is
41
// distinct from phase-16's finding that U does NOT wrap at the depth-
42
// dependent texpage *extent* (128 texels for 8-bit): that boundary sits
43
// below 256 and is a valid 8-bit address that reads adjacent VRAM
44
// linearly. The 256 boundary here is the coordinate width itself
45
// overflowing, which truncates to 8 bits. The two are consistent: linear
46
// across 0..255, wrap at 256.
47
//
48
// If silicon disagrees (OBS shows the >=256 columns/rows reading adjacent
49
// VRAM instead of the wrapped texel), the soft-GPU sampler's 8-bit mask is
50
// wrong and this header gets explicit override constants for the affected
51
// probes. As of authoring, no overrides are needed.
52
53
#include "
raster-helpers.h
"
54
#include "
texture-fixtures.h
"
raster-helpers.h
texture-fixtures.h
Generated by
1.9.8