GPU: Reset hw transform once per frame.

Might prevent potential crashes if it changes mid-frame.
This commit is contained in:
Unknown W. Brackets 2020-04-04 11:21:22 -07:00
parent 30ede8240c
commit 46b9454e73
2 changed files with 6 additions and 1 deletions

View file

@ -37,6 +37,7 @@ DrawEngineCommon::DrawEngineCommon() : decoderMap_(16) {
decJitCache_ = new VertexDecoderJitCache();
transformed = (TransformedVertex *)AllocateMemoryPages(TRANSFORMED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
transformedExpanded = (TransformedVertex *)AllocateMemoryPages(3 * TRANSFORMED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
useHWTransform_ = g_Config.bHardwareTransform;
}
DrawEngineCommon::~DrawEngineCommon() {
@ -171,6 +172,8 @@ void DrawEngineCommon::Resized() {
});
decoderMap_.Clear();
ClearTrackedVertexArrays();
useHWTransform_ = g_Config.bHardwareTransform;
}
u32 DrawEngineCommon::NormalizeVertices(u8 *outPtr, u8 *bufPtr, const u8 *inPtr, int lowerBound, int upperBound, u32 vertType, int *vertexSize) {
@ -738,7 +741,7 @@ void DrawEngineCommon::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim,
}
bool DrawEngineCommon::CanUseHardwareTransform(int prim) {
if (!g_Config.bHardwareTransform)
if (!useHWTransform_)
return false;
return !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES;
}