New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pangya Fantasy Golf: Often crashes when changing equipment in "My Room". #6398
Comments
Okay, I messed around some more, and it seems as if software skinning is the problem. If it's off, the game doesn't crash. |
It probably won't, but does #6402 help? It fixes some cases where vertex arrays are left enabled which has caused crashes in the GPU driver in some games for me. Note that weights are sent as attribs, so that means it could be related to that. -[Unknown] |
Unfortunately, no. It still crashes. |
@unknownbrackets change to if (false) will fix crash. |
What if you disable vertex jit? VertexDecoder.cpp: if (jitCache && g_Config.bVertexDecoderJit) { Replace with -[Unknown] |
How did you manage to get a useful stack trace? :/ |
By disabling vertexjit, it's crashing inside there. My guess is that it's running out of decode buffer space. What are indexLowerBound and indexUpperBound? Although, hmm, shouldn't software skinning run out of space less? It'd be good to know the vertexCount and vertType too (all these variables should be accessible in a debug build by double clicking the appropriate stack lines.) -[Unknown] |
I meant more like how did he know it was in the vertexJIT (aside from the stack trace)? Trial and error with settings I guess.. Anyway, indexUpperBound is 65535 (0xFFFF), lower is 0. vertexCount is 65536 (0x10000), vertType is 302110691 (0x1201d7e3). |
That vertexcount is off the charts, I haven't seen any PSP game draw that much in one call (only the "Sprite" homebrew demo). Seems likely to be bogus, maybe a game bug, especially in the context of a simple club changing screen... Any chance you can trace it back to the previous PRIM call? Maybe add a little check for one with many verts. Would be interesting to see if it's an indexed draw, and which prim it is. BTW, if you get crap stack traces, odds are that it's in one of the JITs. We don't have that many, so trying to disable the vertex jit is a pretty logical thing to do :) |
Yeah, that's why I guessed it was in vertexjit (and that particular usage of g_Config.bSoftwareSkinning is a main entry for the vertexjit iirc.) Wait, that vertexCount shouldn't be valid: Line 733 in 1a830b1
It can't be > 0xFFFF... can it? It's also == the max: ppsspp/GPU/GLES/TransformPipeline.cpp Line 104 in 1a830b1
It doesn't fix it if you change this to >= does it? ppsspp/GPU/GLES/TransformPipeline.cpp Line 277 in 1a830b1
Does it fix it to increase 48/20 here: ppsspp/GPU/GLES/TransformPipeline.cpp Line 105 in 1a830b1
Maybe to 52/24? -[Unknown] |
That vertexcount is possible if we are combining multiple drawcalls into one big one. Still rather weird. |
Oh, I thought it was the one at SubmitPrim(). -[Unknown] |
Both 2 change still fail |
I feel user_main W[KERNEL]: HLE\sceKernelMemory.cpp:1715 800201b6=sceKernelFreeVpl(288, 09967598): Unable to free is wrong v0.9.8-1380-gb4a9780-windows-amd64 JPCSPTrace log with sceKernelFreeVpl (psp auto off in the loading) |
What happens if you change this: if (g_Config.bSoftwareSkinning && (vertType & GE_VTYPE_WEIGHT_MASK)) {
DecodeVertsStep();
decodeCounter_++;
} To: if (g_Config.bSoftwareSkinning && (vertType & GE_VTYPE_WEIGHT_MASK)) {
DecodeVertsStep();
decodeCounter_++;
Flush();
} Does it still crash, or not anymore? -[Unknown] |
@unknownbrackets: Adding a flush there seems to prevent the crash, at the "cost" of the game freezing for a few seconds while it frees (or tries to, anyhow) a bunch of memory. |
Hmm, if you pause it while it's frozen, are any threads showing a useful stack trace? What is it trying to free? -[Unknown] |
Does this still happen? If yes (I'm assuming yes), what if you increase the buffer sizes in GPU/Common/DrawEngineCommon.cpp? I just want to make sure it is overflowing the buffers. These: enum {
VERTEX_BUFFER_MAX = 65536,
DECODED_VERTEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 48,
DECODED_INDEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 20,
SPLINE_BUFFER_SIZE = VERTEX_BUFFER_MAX * 20,
}; Change to e.g.: enum {
VERTEX_BUFFER_MAX = 65536,
DECODED_VERTEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 64,
DECODED_INDEX_BUFFER_SIZE = VERTEX_BUFFER_MAX * 32,
SPLINE_BUFFER_SIZE = VERTEX_BUFFER_MAX * 32,
}; -[Unknown] |
Last time I checked (like 2 months ago, maybe?) it did. I'll try your change in a little while. |
Still crash in v1.0.1-52-g3773d25 |
@unknownbrackets edit1:Forget 1 change,need re-do |
The game appears to make a draw with bogus index buffer data, causing the vertex decoder to run on way too many vertices. As the game has some rather severe memory management issues:
this is probably not too surprising. We might be able to get around the crash with some sanity checks in the drawing code, but I can't quite figure out where to put them.. |
Use @unknownbrackets this change #6398 (comment)
|
(Simple sanity check when decoding software skinned vertices)
That should take care of it, can you test if it works for you @sum2012 ? |
OK,wait 30 minute |
I test v1.0.1-56-gbfa52e6 fixed |
This crash goes as far back as 0.9.6.2 at least, so I think it's safe to assume it's always existed since the game has run in the emulator.
Steps to reproduce:
Now, about the stack trace: It doesn't matter if JIT is on or off, nor if fast memory is on or off, the emulator will crash with no usable stack trace. See below.
Here's the kicker: If I use softGPU, it does not crash at all. It only crashes with OpenGL.
The text was updated successfully, but these errors were encountered: