PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.09k stars 1.56k forks source link

[BUG]: Jak 2 [SLUS-97265]: issue with DX 11 and Vulkan renderers when mipmapping is used #5286

Closed liamharper2453 closed 2 years ago

liamharper2453 commented 2 years ago

Describe the Bug

In Jak 2, various issues occur when mipmapping is used that varies between renderers:

Vulkan:

No graphical issues at beginning. But just before the intro cutscene loads an assertion fail will appear:

C:\BuildAgent\work\76cd4fe97f2b8d5a\common\Vulkan\Context.cpp(1026) : assertion failed: Function: Vulkan::Context::DoSubmitCommandBuffer Thread: MTGS Condition: false Message: Failed to submit command buffer.

Stacktrace: [00] 0x00FF4CB6
[01] Thrd_yield
[02] 0x018594B2
[03] 0x011F1A5B
[04] 0x014A08AC
[05] 0x014C3184
[06] 0x01483CF4
[07] 0x0130971D
[08] 0x0184D285
[09] 0x0184D1DA
[10] 0x0184D014
[11] 0x0184D04D
[12] time32
[13] BaseThreadInitThunk
[14] RtlGetFullPathName_UEx
[15] RtlGetFullPathName_UEx

Ignoring the assertion will result in cutscene and rest of game playing with sound but no visuals.

Issues only occur when full mipmapping is used, basic and none result in cutscene playing ok.

DX 11:

Had graphical issues throughout on both basic and full mipmapping settings and on full mipmapping just before the intro cutscene loads memory allocation failures get logged (however no assertion failure) and graphics are now a black screen with sound.

Cutscene is ok with no mipmapping used.

OpenGL:

Cutscene appears to progress fine with all mipmapping settings.

All renderers:

Vertex Trace is logged:

Vertex Trace: float overflow detected ! min 3.402823e+38 max 3.402823e+38

Reproduction Steps

Vulkan:

  1. Start new game with mipmapping set to full
  2. Progress past title screen
  3. Create new save game
  4. Observe error after brief black screen

DX11:

  1. Start new game with mipmapping set to full or basic
  2. Progress past title screen
  3. Create new save game
  4. Observe error after brief black screen on full and graphical issues on both basic and full throughout steps 1 to 4.

Expected Behavior

Cutscene appears without errors and crash on DX11 and Vulkan and game has no visual issues when mipmapping is enabled on DX11.

PCSX2 Revision

v1.7.2212

Operating System

Windows 11

If Linux - Specify Distro

No response

CPU

i7-7700k

GPU

GTX 1080ti

GS Settings

Mipmapping: basic/full depending on renderer as above.

All other settings default.

Emulation Settings

All default.

GS Window Screenshots

DX11:

image

Logs & Dumps

Vulkan - Jak II (2022-00-08 22-17-18).zip DX11 - Jak II (2022-00-08 22-40-07).zip

refractionpcsx2 commented 2 years ago

part of the d3d issue, make sure you have "GPU Palette Conversion" ticked, as there's currently an issue with mipmaps when it's off.

ghost commented 2 years ago

Well, hardware mipmapping is currently not working properly in Jak games, or any games if that matter.

liamharper2453 commented 2 years ago

part of the d3d issue, make sure you have "GPU Palette Conversion" ticked, as there's currently an issue with mipmaps when it's off.

Cheers for quick response. Gave this a go with full mipmapping. DX11 graphical issues resolved but graphics freeze with sound still working during intro cutscene. Memory allocation issues logged on freeze.

Vulkan renderer no longer has black screen on intro cutscene but graphics freeze at same spot as DX11 with sound still working with assertion fail:

C:\BuildAgent\work\76cd4fe97f2b8d5a\common\Vulkan\Context.cpp(1026) : assertion failed: Function: Vulkan::Context::DoSubmitCommandBuffer Thread: MTGS Condition: false Message: Failed to submit command buffer.

Stacktrace: [00] 0x00FF4CB6
[01] Thrd_yield
[02] 0x018594B2
[03] 0x011F1A5B
[04] 0x014A08AC
[05] 0x014C3184
[06] 0x01483CF4
[07] 0x0130971D
[08] 0x0184D285
[09] 0x0184D1DA
[10] 0x0184D014
[11] 0x0184D04D
[12] time32
[13] BaseThreadInitThunk
[14] RtlGetFullPathName_UEx
[15] RtlGetFullPathName_UEx
DX11 - Jak II (2022-00-08 22-57-22).zip Vulkan - Jak II (2022-00-08 23-00-53).zip

image

refractionpcsx2 commented 2 years ago

Can confirm it crashes with mipmapping set to full, basic seems okay for me, my log is as such

(DoSubmitCommandBuffer) vkQueueSubmit failed: (-4: VK_ERROR_DEVICE_LOST)

G:\ps2\gitrepo\pcsx2\common\Vulkan\Context.cpp(1026) : assertion failed: Function: Vulkan::Context::DoSubmitCommandBuffer Thread: MTGS Condition: false Message: Failed to submit command buffer.

[00] Vulkan::Context::DoSubmitCommandBuffer \pcsx2\common\Vulkan\Context.cpp:1026 [01] Vulkan::Context::SubmitCommandBuffer \pcsx2\common\Vulkan\Context.cpp:987 [02] VulkanHostDisplay::EndPresent \pcsx2\pcsx2\Frontend\VulkanHostDisplay.cpp:360 [03] Host::EndPresentFrame \pcsx2\pcsx2\gui\AppHost.cpp:163 [04] GSRenderer::VSync \pcsx2\pcsx2\GS\Renderers\Common\GSRenderer.cpp:431 [05] GSRendererHW::VSync \pcsx2\pcsx2\GS\Renderers\HW\GSRendererHW.cpp:309 [06] GSvsync \pcsx2\pcsx2\GS\GS.cpp:474 [07] SysMtgsThread::ExecuteTaskInThread \pcsx2\pcsx2\MTGS.cpp:439 [08] Threading::pxThread::_try_virtual_invoke \pcsx2\common\ThreadTools.cpp:616 [09] Threading::pxThread::_internal_execute \pcsx2\common\ThreadTools.cpp:671 [10] Threading::pxThread::internal_callback_helper \pcsx2\common\ThreadTools.cpp:722 [11] Threading::pxThread::_internal_callback \pcsx2\common\ThreadTools.cpp:709 [12] ptw32_threadStart \pcsx2\3rdparty\pthreads4w\ptw32_threadStart.c:184

refractionpcsx2 commented 2 years ago

tagging @stenzek

stenzek commented 2 years ago

Should hopefully be all fixed with https://github.com/PCSX2/pcsx2/pull/5290

coornio commented 2 years ago

I decided to check this as well before the PR was merged, with r2212.

No matter what I tried, I experienced absolutely zero issues in vulkan. I was able though to get something similar in D3D11. Daxter was mostly black, the billboard logo seen in the picture of the issue was fine (if not a bit more orange than it should be?) and the game hanged as soon as the cinematic began with GS: Memory allocation failure spam.

I am not certain if this information is important, but here it is.