xemu-project / xemu

Original Xbox Emulator for Windows, macOS, and Linux (Active Development)
https://xemu.app
Other
2.79k stars 280 forks source link

Splinter cell double agent: steam heat waves effect not handled correctly without goggles #786

Closed Fabxx closed 2 years ago

Fabxx commented 2 years ago

Title

https://xemu.app/titles/5553005e/#Tom-Clancy-s-Splinter-Cell-Double-Agent

Bug Description

RE-tested on master:

https://user-images.githubusercontent.com/30447649/159268322-1639ca0b-3b90-4500-859a-4273d7265235.mp4

WHere is happens: Level name: Iceland, first part, second part kinshasa, second part beginning sea of okosth, first part oging through a fire camp

Expected Behavior

Steam waves should not cause a blue screen

xemu Version

xemu_version: 0.6.2-88-g6e1969001e

System Information

Manjaro Linux i7-10700 4.80GHz GTX 970 STRIX 4GB VRAM Nvidia driver 510.54 - CUDA Version 11.6

Additional Context

Fabxx commented 2 years ago

i've decided to split the issues in separate ones since they might be related to different things, and to keep tracks of them in a proper way. NOTE: these issues can be replicated in chaos theory too.

abaire commented 2 years ago

I would guess that the blue screen is just another artifact of #788. Please check to see if #831 fixes this problem and close this bug as a duplicate of #788 if it does.

UPDATE: I'm wrong, this issue persists with 831 and 832 applied.

abaire commented 2 years ago

Relevant pixel shader:

// Stage 0
ab.rgb = clamp(vec3((t0.rgb * v0.rgb)), -1.0, 1.0);
r0.rgb = ab.rgb;
ab.a = clamp(((t0.a * v0.a)), -1.0, 1.0);
r0.a = ab.a;
// Final Combiner
fragColor.rgb = max(clamp(vec4(v1.rgb + r0.rgb, 0.0), 0.0, 1.0).rgb, 0.0) + mix(vec3(max(vec4(0.0).rgb, 0.0)), vec3(max(vec4(0.0).rgb, 0.0)), vec3(max(vec4(0.0).rgb, 0.0)));
fragColor.a = max(r0.a, 0.0);
if (!(fragColor.a > alphaRef)) discard;

Note that it's using alpha kill, the input to the shader is a 64x64 grey sphere.

The blue screen is initially rendered to a separate 640x480 texture from the scene compositing. I'll need to look at the pgraph to see which one is supposed to be the backbuffer, but it looks like the blue is probably meant to be overlaid on top of the existing scene where the blue would presumably be color keyed or alpha killed away.

abaire commented 2 years ago

pgraph

scda_steam.txt

abaire commented 2 years ago

Hardware screengrab around the same location: xbox_steam_pipe

abaire commented 2 years ago

The blue background in the first render pass cited above looks to be intentional. Looking at the pgraph it's setting the clear color to 0xFF0000FF just after setting the color offset to the output address, so I'd guess that the issue is with compositing later on and/or that the alpha kill is incorrect.

Update: more or less confirmed, I see the same sort of primarily blue rendering when looking at hardware artifacts

I see some interesting values used for the SET_SURFACE_CLIP commands when dealing with the blue texture. Comparing to hardware output, the stages that do this in xemu look like they may be obliterating the target surface whereas it looks like the HW may only update the given region

I also see that at the point the outputs appear to diverge, there's another image blit that appears to fail (similar to #831). As far as I can tell, it should be blitting a copy of the backbuffer into the texture that is the input to draw 378 in my test frame.

Relevant part of the pgraph trace, note the 0x62 and 0x9f blit before the texture is applied.

// 378?
// Maybe maps to draw 409 in the HW trace.
// HW output is to a non-FB texture (same addres 0x273c000) and is dramatically different from this.
nv2a_pgraph_method 3: 0x62 -> 0x0308 ?[0] 0x2c40000
nv2a_pgraph_method 3: 0x62 -> 0x030c ?[0] 0x277c000
nv2a_pgraph_method 3: 0x62 -> 0x0300 ?[0] 0xa
nv2a_pgraph_method 3: 0x62 -> 0x0304 ?[0] 0xa000a00
nv2a_pgraph_method 2: 0x9f -> 0x0300 ?[0] 0x0
nv2a_pgraph_method 2: 0x9f -> 0x0304 ?[0] 0x0
nv2a_pgraph_method 2: 0x9f -> 0x0308 ?[0] 0x1e00280
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x020c NV097_SET_SURFACE_PITCH[0] 0xa000400
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0110 NV097_WAIT_FOR_IDLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0210 NV097_SET_SURFACE_COLOR_OFFSET[0] 0x273c000
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0110 NV097_WAIT_FOR_IDLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0214 NV097_SET_SURFACE_ZETA_OFFSET[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0110 NV097_WAIT_FOR_IDLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x020c NV097_SET_SURFACE_PITCH[0] 0xa000400
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0110 NV097_WAIT_FOR_IDLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0210 NV097_SET_SURFACE_COLOR_OFFSET[0] 0x273c000
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0110 NV097_WAIT_FOR_IDLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0214 NV097_SET_SURFACE_ZETA_OFFSET[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0100 NV097_NO_OPERATION[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0110 NV097_WAIT_FOR_IDLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0290 NV097_SET_CONTROL0[0] 0x100001
nv2a_pgraph_method 0: 0x97 -> 0x030c NV097_SET_DEPTH_TEST_ENABLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x032c NV097_SET_STENCIL_TEST_ENABLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0208 NV097_SET_SURFACE_FORMAT[0] 0x8080228
nv2a_pgraph_method 0: 0x97 -> 0x1d7c ?[0] 0xffff0000
nv2a_pgraph_method_unhandled 0: 0x97 -> 0x1d7c 0xffff0000
nv2a_pgraph_method 0: 0x97 -> 0x0200 NV097_SET_SURFACE_CLIP_HORIZONTAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x0204 NV097_SET_SURFACE_CLIP_VERTICAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x02b4 NV097_SET_WINDOW_CLIP_TYPE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x02c0 NV097_SET_WINDOW_CLIP_HORIZONTAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x02e0 NV097_SET_WINDOW_CLIP_VERTICAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x0a20 NV097_SET_VIEWPORT_OFFSET[0] 0x43008800
nv2a_pgraph_method 0: 0x97 -> 0x0a24 NV097_SET_VIEWPORT_OFFSET[4] 0x43008800
nv2a_pgraph_method 0: 0x97 -> 0x0a28 NV097_SET_VIEWPORT_OFFSET[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a2c NV097_SET_VIEWPORT_OFFSET[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0af0 NV097_SET_VIEWPORT_SCALE[0] 0x43000000
nv2a_pgraph_method 0: 0x97 -> 0x0af4 NV097_SET_VIEWPORT_SCALE[4] 0xc3000000
nv2a_pgraph_method 0: 0x97 -> 0x0af8 NV097_SET_VIEWPORT_SCALE[8] 0x4b7fffff
nv2a_pgraph_method 0: 0x97 -> 0x0afc NV097_SET_VIEWPORT_SCALE[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0394 NV097_SET_CLIP_MIN[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0398 NV097_SET_CLIP_MAX[0] 0x4b7fffff
nv2a_pgraph_method 0: 0x97 -> 0x0200 NV097_SET_SURFACE_CLIP_HORIZONTAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x0204 NV097_SET_SURFACE_CLIP_VERTICAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x02b4 NV097_SET_WINDOW_CLIP_TYPE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x02c0 NV097_SET_WINDOW_CLIP_HORIZONTAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x02e0 NV097_SET_WINDOW_CLIP_VERTICAL[0] 0x1000000
nv2a_pgraph_method 0: 0x97 -> 0x0a20 NV097_SET_VIEWPORT_OFFSET[0] 0x43008800
nv2a_pgraph_method 0: 0x97 -> 0x0a24 NV097_SET_VIEWPORT_OFFSET[4] 0x43008800
nv2a_pgraph_method 0: 0x97 -> 0x0a28 NV097_SET_VIEWPORT_OFFSET[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a2c NV097_SET_VIEWPORT_OFFSET[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0af0 NV097_SET_VIEWPORT_SCALE[0] 0x43000000
nv2a_pgraph_method 0: 0x97 -> 0x0af4 NV097_SET_VIEWPORT_SCALE[4] 0xc3000000
nv2a_pgraph_method 0: 0x97 -> 0x0af8 NV097_SET_VIEWPORT_SCALE[8] 0x4b7fffff
nv2a_pgraph_method 0: 0x97 -> 0x0afc NV097_SET_VIEWPORT_SCALE[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0394 NV097_SET_CLIP_MIN[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0398 NV097_SET_CLIP_MAX[0] 0x4b7fffff
nv2a_pgraph_method 0: 0x97 -> 0x0260 NV097_SET_COMBINER_ALPHA_ICW[0] 0xd8d11010
nv2a_pgraph_method 0: 0x97 -> 0x0264 NV097_SET_COMBINER_ALPHA_ICW[4] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0268 NV097_SET_COMBINER_ALPHA_ICW[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x026c NV097_SET_COMBINER_ALPHA_ICW[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0270 NV097_SET_COMBINER_ALPHA_ICW[16] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0274 NV097_SET_COMBINER_ALPHA_ICW[20] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0278 NV097_SET_COMBINER_ALPHA_ICW[24] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x027c NV097_SET_COMBINER_ALPHA_ICW[28] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a60 NV097_SET_COMBINER_FACTOR0[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a64 NV097_SET_COMBINER_FACTOR0[4] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a68 NV097_SET_COMBINER_FACTOR0[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a6c NV097_SET_COMBINER_FACTOR0[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a70 NV097_SET_COMBINER_FACTOR0[16] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a74 NV097_SET_COMBINER_FACTOR0[20] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a78 NV097_SET_COMBINER_FACTOR0[24] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a7c NV097_SET_COMBINER_FACTOR0[28] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a80 NV097_SET_COMBINER_FACTOR1[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a84 NV097_SET_COMBINER_FACTOR1[4] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a88 NV097_SET_COMBINER_FACTOR1[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a8c NV097_SET_COMBINER_FACTOR1[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a90 NV097_SET_COMBINER_FACTOR1[16] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a94 NV097_SET_COMBINER_FACTOR1[20] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a98 NV097_SET_COMBINER_FACTOR1[24] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0a9c NV097_SET_COMBINER_FACTOR1[28] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0aa0 NV097_SET_COMBINER_ALPHA_OCW[0] 0xc0
nv2a_pgraph_method 0: 0x97 -> 0x0aa4 NV097_SET_COMBINER_ALPHA_OCW[4] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0aa8 NV097_SET_COMBINER_ALPHA_OCW[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0aac NV097_SET_COMBINER_ALPHA_OCW[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ab0 NV097_SET_COMBINER_ALPHA_OCW[16] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ab4 NV097_SET_COMBINER_ALPHA_OCW[20] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ab8 NV097_SET_COMBINER_ALPHA_OCW[24] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0abc NV097_SET_COMBINER_ALPHA_OCW[28] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ac0 NV097_SET_COMBINER_COLOR_ICW[0] 0xc8c10000
nv2a_pgraph_method 0: 0x97 -> 0x0ac4 NV097_SET_COMBINER_COLOR_ICW[4] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ac8 NV097_SET_COMBINER_COLOR_ICW[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0acc NV097_SET_COMBINER_COLOR_ICW[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ad0 NV097_SET_COMBINER_COLOR_ICW[16] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ad4 NV097_SET_COMBINER_COLOR_ICW[20] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0ad8 NV097_SET_COMBINER_COLOR_ICW[24] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0adc NV097_SET_COMBINER_COLOR_ICW[28] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x17f8 NV097_SET_SHADER_CLIP_PLANE_MODE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e20 NV097_SET_SPECULAR_FOG_FACTOR[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e24 NV097_SET_SPECULAR_FOG_FACTOR[4] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e40 NV097_SET_COMBINER_COLOR_OCW[0] 0xc0
nv2a_pgraph_method 0: 0x97 -> 0x1e44 NV097_SET_COMBINER_COLOR_OCW[4] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e48 NV097_SET_COMBINER_COLOR_OCW[8] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e4c NV097_SET_COMBINER_COLOR_OCW[12] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e50 NV097_SET_COMBINER_COLOR_OCW[16] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e54 NV097_SET_COMBINER_COLOR_OCW[20] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e58 NV097_SET_COMBINER_COLOR_OCW[24] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e5c NV097_SET_COMBINER_COLOR_OCW[28] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e60 NV097_SET_COMBINER_CONTROL[0] 0x11101
nv2a_pgraph_method 0: 0x97 -> 0x1e74 NV097_SET_DOT_RGBMAPPING[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1e78 NV097_SET_SHADER_OTHER_STAGE_INPUT[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1b00 NV097_SET_TEXTURE_OFFSET[0] 0x277c000
nv2a_pgraph_method 0: 0x97 -> 0x1b04 NV097_SET_TEXTURE_FORMAT[0] 0x11229
nv2a_pgraph_method 0: 0x97 -> 0x1b10 NV097_SET_TEXTURE_CONTROL1[0] 0xa000000
nv2a_pgraph_method 0: 0x97 -> 0x1b1c NV097_SET_TEXTURE_IMAGE_RECT[0] 0x28001e0
nv2a_pgraph_method 0: 0x97 -> 0x1b0c NV097_SET_TEXTURE_CONTROL0[0] 0x4003ffc0
nv2a_pgraph_method 0: 0x97 -> 0x1ea4 NV097_SET_TRANSFORM_CONSTANT_LOAD[0] 0x74
nv2a_pgraph_method 0: 0x97 -> 0x0b80 NV097_SET_TRANSFORM_CONSTANT[0] 0x44200000
nv2a_pgraph_method 0: 0x97 -> 0x0b84 NV097_SET_TRANSFORM_CONSTANT[4] 0xc3f00000
nv2a_pgraph_method 0: 0x97 -> 0x0b88 NV097_SET_TRANSFORM_CONSTANT[8] 0xbacccccd
nv2a_pgraph_method 0: 0x97 -> 0x0b8c NV097_SET_TRANSFORM_CONSTANT[12] 0x43f00044
nv2a_pgraph_method 0: 0x97 -> 0x0b90 NV097_SET_TRANSFORM_CONSTANT[16] 0x44200000
nv2a_pgraph_method 0: 0x97 -> 0x0b94 NV097_SET_TRANSFORM_CONSTANT[20] 0xc3f00000
nv2a_pgraph_method 0: 0x97 -> 0x0b98 NV097_SET_TRANSFORM_CONSTANT[24] 0x3acccccd
nv2a_pgraph_method 0: 0x97 -> 0x0b9c NV097_SET_TRANSFORM_CONSTANT[28] 0x43f00044
nv2a_pgraph_method 0: 0x97 -> 0x0ba0 NV097_SET_TRANSFORM_CONSTANT[32] 0x44200000
nv2a_pgraph_method 0: 0x97 -> 0x0ba4 NV097_SET_TRANSFORM_CONSTANT[36] 0xc3f00000
nv2a_pgraph_method 0: 0x97 -> 0x0ba8 NV097_SET_TRANSFORM_CONSTANT[40] 0xbacccccd
nv2a_pgraph_method 0: 0x97 -> 0x0bac NV097_SET_TRANSFORM_CONSTANT[44] 0x43efffbc
nv2a_pgraph_method 0: 0x97 -> 0x0bb0 NV097_SET_TRANSFORM_CONSTANT[48] 0x44200000
nv2a_pgraph_method 0: 0x97 -> 0x0bb4 NV097_SET_TRANSFORM_CONSTANT[52] 0xc3f00000
nv2a_pgraph_method 0: 0x97 -> 0x0bb8 NV097_SET_TRANSFORM_CONSTANT[56] 0x3acccccd
nv2a_pgraph_method 0: 0x97 -> 0x0bbc NV097_SET_TRANSFORM_CONSTANT[60] 0x43efffbc
nv2a_pgraph_method 0: 0x97 -> 0x0a60 NV097_SET_COMBINER_FACTOR0[0] 0xffffffff
nv2a_pgraph_method 0: 0x97 -> 0x181c NV097_SET_EYE_VECTOR[0] 0x3f800000
nv2a_pgraph_method 0: 0x97 -> 0x1820 NV097_SET_EYE_VECTOR[4] 0x3f800000
nv2a_pgraph_method 0: 0x97 -> 0x1824 NV097_SET_EYE_VECTOR[8] 0x3f800000
nv2a_pgraph_method 0: 0x97 -> 0x030c NV097_SET_DEPTH_TEST_ENABLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x1d78 ?[0] 0x1
nv2a_pgraph_method_unhandled 0: 0x97 -> 0x1d78 0x1
nv2a_pgraph_method 0: 0x97 -> 0x0358 NV097_SET_COLOR_MASK[0] 0x1010101
nv2a_pgraph_method 0: 0x97 -> 0x0354 NV097_SET_DEPTH_FUNC[0] 0x203
nv2a_pgraph_method 0: 0x97 -> 0x1e9c NV097_SET_TRANSFORM_PROGRAM_LOAD[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0b00 NV097_SET_TRANSFORM_PROGRAM[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0b04 NV097_SET_TRANSFORM_PROGRAM[4] 0x8c0015
nv2a_pgraph_method 0: 0x97 -> 0x0b08 NV097_SET_TRANSFORM_PROGRAM[8] 0x9fe1ea8
nv2a_pgraph_method 0: 0x97 -> 0x0b0c NV097_SET_TRANSFORM_PROGRAM[12] 0x30b0c800
nv2a_pgraph_method 0: 0x97 -> 0x0b10 NV097_SET_TRANSFORM_PROGRAM[16] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0b14 NV097_SET_TRANSFORM_PROGRAM[20] 0x62c00aa
nv2a_pgraph_method 0: 0x97 -> 0x0b18 NV097_SET_TRANSFORM_PROGRAM[24] 0xc0012a8
nv2a_pgraph_method 0: 0x97 -> 0x0b1c NV097_SET_TRANSFORM_PROGRAM[28] 0x30b83800
nv2a_pgraph_method 0: 0x97 -> 0x0b20 NV097_SET_TRANSFORM_PROGRAM[32] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0b24 NV097_SET_TRANSFORM_PROGRAM[36] 0x8e8015
nv2a_pgraph_method 0: 0x97 -> 0x0b28 NV097_SET_TRANSFORM_PROGRAM[40] 0x82a9afd
nv2a_pgraph_method 0: 0x97 -> 0x0b2c NV097_SET_TRANSFORM_PROGRAM[44] 0x3090c848
nv2a_pgraph_method 0: 0x97 -> 0x0b30 NV097_SET_TRANSFORM_PROGRAM[48] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0b34 NV097_SET_TRANSFORM_PROGRAM[52] 0x47401a
nv2a_pgraph_method 0: 0x97 -> 0x0b38 NV097_SET_TRANSFORM_PROGRAM[56] 0xc4355800
nv2a_pgraph_method 0: 0x97 -> 0x0b3c NV097_SET_TRANSFORM_PROGRAM[60] 0x20a0e800
nv2a_pgraph_method 0: 0x97 -> 0x0b40 NV097_SET_TRANSFORM_PROGRAM[64] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0b44 NV097_SET_TRANSFORM_PROGRAM[68] 0x87601a
nv2a_pgraph_method 0: 0x97 -> 0x0b48 NV097_SET_TRANSFORM_PROGRAM[72] 0xc400286a
nv2a_pgraph_method 0: 0x97 -> 0x0b4c NV097_SET_TRANSFORM_PROGRAM[76] 0xf0b0e801
nv2a_pgraph_method 0: 0x97 -> 0x1ea0 NV097_SET_TRANSFORM_PROGRAM_START[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x0318 NV097_SET_POINT_PARAMS_ENABLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x031c NV097_SET_POINT_SMOOTH_ENABLE[0] 0x0
nv2a_pgraph_method 0: 0x97 -> 0x043c NV097_SET_POINT_SIZE[0] 0x8
nv2a_pgraph_method 0: 0x97 -> 0x1e70 NV097_SET_SHADER_STAGE_PROGRAM[0] 0x1
nv2a_pgraph_method 0: 0x97 -> 0x1b08 NV097_SET_TEXTURE_ADDRESS[0] 0x10303
nv2a_pgraph_method 0: 0x97 -> 0x1b0c NV097_SET_TEXTURE_CONTROL0[0] 0x4003ffc0
nv2a_pgraph_method 0: 0x97 -> 0x1b14 NV097_SET_TEXTURE_FILTER[0] 0x2043f81
nv2a_pgraph_method 0: 0x97 -> 0x1760 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[0] 0x440
nv2a_pgraph_method 0: 0x97 -> 0x1764 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[4] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1768 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[8] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x176c NV097_SET_VERTEX_DATA_ARRAY_FORMAT[12] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1770 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[16] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1774 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[20] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1778 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[24] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x177c NV097_SET_VERTEX_DATA_ARRAY_FORMAT[28] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1780 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[32] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1784 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[36] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1788 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[40] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x178c NV097_SET_VERTEX_DATA_ARRAY_FORMAT[44] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1790 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[48] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1794 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[52] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1798 NV097_SET_VERTEX_DATA_ARRAY_FORMAT[56] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x179c NV097_SET_VERTEX_DATA_ARRAY_FORMAT[60] 0x402
nv2a_pgraph_method 0: 0x97 -> 0x1720 NV097_SET_VERTEX_DATA_ARRAY_OFFSET[0] 0x3193000
nv2a_pgraph_method 0: 0x97 -> 0x17fc NV097_SET_BEGIN_END[0] 0x5
nv2a_pgraph_method_abbrev 0: 0x97 -> 0x1800 NV097_ARRAY_ELEMENT16 * 2
nv2a_pgraph_method 0: 0x97 -> 0x17fc NV097_SET_BEGIN_END[0] 0x0
abaire commented 2 years ago

I suspect the issue is the blit. I believe xemu performs the blit correctly in RAM, and correctly flags the texture as requiring upload, but does not actually upload the texture before using it in the render.

Stepping through pgraph_bind_textures just after doing the image blit, possibly_dirty is set to false and it ends up dropping into the // Saved an upload! Reuse existing texture in graphics memory. path erroneously, reusing stale GPU data instead of the updated RAM data. It seems like this should check the memory dirty flags or even simply surface->upload_pending (it does find the existing surface and that flag is set correctly in the blitter) before deciding to reuse the texture.

Fabxx commented 2 years ago

Re-tested with lastes master image

abaire commented 2 years ago

The optimization that was done as part of the #835 PR review causes the regression but interestingly still allows the tests to pass so there's some component of the game behavior that is not fully captured in the tests. Will send a followup proposal.