softgpu: Avoid unnecessary flushing for curves.
We don't need to flush all drawing between curves in softgpu, let them queue up.
This commit is contained in:
parent
337518415e
commit
fc39f042ae
4 changed files with 9 additions and 3 deletions
|
@ -147,6 +147,8 @@ protected:
|
||||||
|
|
||||||
bool useHWTransform_ = false;
|
bool useHWTransform_ = false;
|
||||||
bool useHWTessellation_ = false;
|
bool useHWTessellation_ = false;
|
||||||
|
// Used to prevent unnecessary flushing in softgpu.
|
||||||
|
bool flushOnParams_ = true;
|
||||||
|
|
||||||
// Vertex collector buffers
|
// Vertex collector buffers
|
||||||
u8 *decoded = nullptr;
|
u8 *decoded = nullptr;
|
||||||
|
|
|
@ -577,6 +577,7 @@ void DrawEngineCommon::SubmitCurve(const void *control_points, const void *indic
|
||||||
if (output.count)
|
if (output.count)
|
||||||
DispatchSubmitPrim(output.vertices, output.indices, PatchPrimToPrim(surface.primType), output.count, vertTypeID, gstate.getCullMode(), &generatedBytesRead);
|
DispatchSubmitPrim(output.vertices, output.indices, PatchPrimToPrim(surface.primType), output.count, vertTypeID, gstate.getCullMode(), &generatedBytesRead);
|
||||||
|
|
||||||
|
if (flushOnParams_)
|
||||||
DispatchFlush();
|
DispatchFlush();
|
||||||
|
|
||||||
if (origVertType & GE_VTYPE_TC_MASK) {
|
if (origVertType & GE_VTYPE_TC_MASK) {
|
||||||
|
|
|
@ -1942,6 +1942,7 @@ void GPUCommon::Execute_Bezier(u32 op, u32 diff) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't flush after setting gstate_c.submitType below since it'll be a mess - it must be done already.
|
// Can't flush after setting gstate_c.submitType below since it'll be a mess - it must be done already.
|
||||||
|
if (flushOnParams_)
|
||||||
drawEngineCommon_->DispatchFlush();
|
drawEngineCommon_->DispatchFlush();
|
||||||
|
|
||||||
Spline::BezierSurface surface;
|
Spline::BezierSurface surface;
|
||||||
|
@ -2014,6 +2015,7 @@ void GPUCommon::Execute_Spline(u32 op, u32 diff) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't flush after setting gstate_c.submitType below since it'll be a mess - it must be done already.
|
// Can't flush after setting gstate_c.submitType below since it'll be a mess - it must be done already.
|
||||||
|
if (flushOnParams_)
|
||||||
drawEngineCommon_->DispatchFlush();
|
drawEngineCommon_->DispatchFlush();
|
||||||
|
|
||||||
Spline::SplineSurface surface;
|
Spline::SplineSurface surface;
|
||||||
|
|
|
@ -54,6 +54,7 @@ SoftwareDrawEngine::SoftwareDrawEngine() {
|
||||||
// All this is a LOT of memory, need to see if we can cut down somehow. Used for splines.
|
// All this is a LOT of memory, need to see if we can cut down somehow. Used for splines.
|
||||||
decoded = (u8 *)AllocateMemoryPages(DECODED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
|
decoded = (u8 *)AllocateMemoryPages(DECODED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
|
||||||
decIndex = (u16 *)AllocateMemoryPages(DECODED_INDEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
|
decIndex = (u16 *)AllocateMemoryPages(DECODED_INDEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
|
||||||
|
flushOnParams_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SoftwareDrawEngine::~SoftwareDrawEngine() {
|
SoftwareDrawEngine::~SoftwareDrawEngine() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue