diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 0735319977de..94a44398e27c 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -28,6 +28,7 @@ using namespace PPSSPP_VK; // renderPass is an example of the "compatibility class" or RenderPassType type. bool VKRGraphicsPipeline::Create(VulkanContext *vulkan, VkRenderPass compatibleRenderPass, RenderPassType rpType, VkSampleCountFlagBits sampleCount, double scheduleTime, int countToCompile) { + _dbg_assert_(desc); // Good torture test to test the shutdown-while-precompiling-shaders issue on PC where it's normally // hard to catch because shaders compile so fast. // sleep_ms(200); diff --git a/Core/Config.cpp b/Core/Config.cpp index 66f9ab7419bf..45ac4ea454b9 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -140,7 +140,15 @@ const char *DefaultLangRegion() { } static int DefaultDepthRaster() { -#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS) + // All single cores default to off. + if (cpu_info.num_cores == 1) { + return (int)DepthRasterMode::OFF; + } + + // ARMv7 also defaults to off. +#if PPSSPP_PLATFORM(ARM) + return (int)DepthRasterMode::OFF; +#elif PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS) return (int)DepthRasterMode::LOW_QUALITY; #else return (int)DepthRasterMode::DEFAULT; diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index 3faf79c1e898..2b20d1b86543 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -23,6 +23,7 @@ #include "Common/LogReporting.h" #include "Common/Math/SIMDHeaders.h" #include "Common/Math/CrossSIMD.h" +#include "Common/Thread/ThreadUtil.h" #include "Common/Math/lin/matrix4x4.h" #include "Common/TimeUtil.h" #include "Core/System.h" @@ -54,7 +55,7 @@ DrawEngineCommon::DrawEngineCommon() : decoderMap_(32) { transformedExpanded_ = (TransformedVertex *)AllocateMemoryPages(3 * TRANSFORMED_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); - indexGen.Setup(decIndex_); + indexGen_.Setup(decIndex_); switch ((DepthRasterMode)g_Config.iDepthRasterMode) { case DepthRasterMode::DEFAULT: @@ -69,6 +70,7 @@ DrawEngineCommon::DrawEngineCommon() : decoderMap_(32) { } if (useDepthRaster_) { depthDraws_.reserve(256); + depthThread_ = std::thread([this]() { DepthThreadFunc(); }); } } @@ -87,6 +89,11 @@ DrawEngineCommon::~DrawEngineCommon() { delete decoder; }); ClearSplineBezierWeights(); + if (depthThread_.joinable()) { + exitDepthThread_ = true; + depthEnqueueCond_.notify_one(); + depthThread_.join(); + } } void DrawEngineCommon::Init() { @@ -677,7 +684,7 @@ int DrawEngineCommon::ExtendNonIndexedPrim(const uint32_t *cmd, const uint32_t * } void DrawEngineCommon::SkipPrim(GEPrimitiveType prim, int vertexCount, VertexDecoder *dec, u32 vertTypeID, int *bytesRead) { - if (!indexGen.PrimCompatible(prevPrim_, prim)) { + if (!indexGen_.PrimCompatible(prevPrim_, prim)) { Flush(); } @@ -697,7 +704,7 @@ void DrawEngineCommon::SkipPrim(GEPrimitiveType prim, int vertexCount, VertexDec // vertTypeID is the vertex type but with the UVGen mode smashed into the top bits. bool DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimitiveType prim, int vertexCount, VertexDecoder *dec, u32 vertTypeID, bool clockwise, int *bytesRead) { - if (!indexGen.PrimCompatible(prevPrim_, prim) || numDrawVerts_ >= MAX_DEFERRED_DRAW_VERTS || numDrawInds_ >= MAX_DEFERRED_DRAW_INDS || vertexCountInDrawCalls_ + vertexCount > VERTEX_BUFFER_MAX) { + if (!indexGen_.PrimCompatible(prevPrim_, prim) || numDrawVerts_ >= MAX_DEFERRED_DRAW_VERTS || numDrawInds_ >= MAX_DEFERRED_DRAW_INDS || vertexCountInDrawCalls_ + vertexCount > VERTEX_BUFFER_MAX) { Flush(); } _dbg_assert_(numDrawVerts_ < MAX_DEFERRED_DRAW_VERTS); @@ -838,22 +845,22 @@ int DrawEngineCommon::DecodeInds() { // 2. Loop through the drawcalls, translating indices as we go. switch (di.indexType) { case GE_VTYPE_IDX_NONE >> GE_VTYPE_IDX_SHIFT: - indexGen.AddPrim(di.prim, di.vertexCount, indexOffset, clockwise); + indexGen_.AddPrim(di.prim, di.vertexCount, indexOffset, clockwise); break; case GE_VTYPE_IDX_8BIT >> GE_VTYPE_IDX_SHIFT: - indexGen.TranslatePrim(di.prim, di.vertexCount, (const u8 *)di.inds, indexOffset, clockwise); + indexGen_.TranslatePrim(di.prim, di.vertexCount, (const u8 *)di.inds, indexOffset, clockwise); break; case GE_VTYPE_IDX_16BIT >> GE_VTYPE_IDX_SHIFT: - indexGen.TranslatePrim(di.prim, di.vertexCount, (const u16_le *)di.inds, indexOffset, clockwise); + indexGen_.TranslatePrim(di.prim, di.vertexCount, (const u16_le *)di.inds, indexOffset, clockwise); break; case GE_VTYPE_IDX_32BIT >> GE_VTYPE_IDX_SHIFT: - indexGen.TranslatePrim(di.prim, di.vertexCount, (const u32_le *)di.inds, indexOffset, clockwise); + indexGen_.TranslatePrim(di.prim, di.vertexCount, (const u32_le *)di.inds, indexOffset, clockwise); break; } } decodeIndsCounter_ = i; - return indexGen.VertexCount(); + return indexGen_.VertexCount(); } bool DrawEngineCommon::CanUseHardwareTransform(int prim) const { @@ -1001,6 +1008,142 @@ bool DrawEngineCommon::CalculateDepthDraw(DepthDraw *draw, GEPrimitiveType prim, return true; } +// TODO: Possibly split this in stages, to avoid switching back and forth between clipping and drawing. +void DrawEngineCommon::ProcessDepthDraw(const DepthDraw &draw) { + int *tx = depthScreenVerts_; + int *ty = depthScreenVerts_ + DEPTH_SCREENVERTS_COMPONENT_COUNT; + float *tz = (float *)(depthScreenVerts_ + DEPTH_SCREENVERTS_COMPONENT_COUNT * 2); + + int outVertCount = 0; + + const float *vertices = depthTransformed_ + 4 * draw.vertexOffset; + const uint16_t *indices = depthIndices_ + draw.indexOffset; + + DepthScissor tileScissor = draw.scissor.Tile(0, 1); + + const bool collectStats = coreCollectDebugStats; + const bool lowQ = g_Config.iDepthRasterMode == (int)DepthRasterMode::LOW_QUALITY; + + { + TimeCollector collectStat(&gpuStats.msCullDepth, collectStats); + switch (draw.prim) { + case GE_PRIM_RECTANGLES: + outVertCount = DepthRasterClipIndexedRectangles(tx, ty, tz, vertices, indices, draw, tileScissor); + break; + case GE_PRIM_TRIANGLES: + outVertCount = DepthRasterClipIndexedTriangles(tx, ty, tz, vertices, indices, draw, tileScissor); + break; + default: + _dbg_assert_(false); + break; + } + } + { + TimeCollector collectStat(&gpuStats.msRasterizeDepth, collectStats); + DepthRasterScreenVerts((uint16_t *)Memory::GetPointerWrite(draw.depthAddr), draw.depthStride, tx, ty, tz, outVertCount, draw, tileScissor, lowQ); + } +} + +void DrawEngineCommon::EnqueueDepthDraw(const DepthDraw &draw) { + std::lock_guard lock(depthEnqueueMutex_); + if (depthDraws_.empty()) { + _dbg_assert_(curDraw_ == 0); + _dbg_assert_(!inDepthDrawPass_); + depthDraws_.push_back(draw); + depthRasterPassStart_ = time_now_d(); + inDepthDrawPass_ = true; + depthEnqueueCond_.notify_one(); + } else { + depthDraws_.push_back(draw); + depthEnqueueCond_.notify_one(); // In case the thread caught up. + } +} + +// Returns true if we actually waited. +void DrawEngineCommon::WaitForDepthPassFinish() { + { + std::lock_guard lock(depthEnqueueMutex_); + // In case the depth raster thread is idle, we need to nudge it. + _dbg_assert_(!finishedSubmitting_); + finishedSubmitting_ = true; + depthEnqueueCond_.notify_one(); + } + + // OK, we're in a pass. Wait for the thread to finish work. + std::unique_lock lock(depthFinishMutex_); + while (!finishedDrawing_) { + depthFinishCond_.wait(lock); + } +} + +void DrawEngineCommon::FlushQueuedDepth() { + if (depthRasterPassStart_ != 0.0) { + gpuStats.msRasterTimeAvailable += time_now_d() - depthRasterPassStart_; + depthRasterPassStart_ = 0.0; + } + + if (inDepthDrawPass_) { + WaitForDepthPassFinish(); + // At this point, we know that the depth thread is paused. + + // Reset queue + depthIndexCount_ = 0; + depthVertexCount_ = 0; + depthDraws_.clear(); + inDepthDrawPass_ = false; + finishedSubmitting_ = false; + finishedDrawing_ = false; // not sure if it matters who resets this. + curDraw_ = 0; + } else { + _dbg_assert_(curDraw_ == 0); + _dbg_assert_(!inDepthDrawPass_); + } +} + +void DrawEngineCommon::DepthThreadFunc() { + SetCurrentThreadName("DepthRaster"); + + while (true) { + DepthDraw draw; + bool hasDraw = false; + // Wait for a draw or exit. + { + std::unique_lock lock(depthEnqueueMutex_); + if (depthDraws_.size() == curDraw_) { + gpuStats.numDepthThreadCaughtUp++; + // We've drawn all we can. Let's check if we're finished. + // If we reach here, we've drawn everything we can. And if that's the last + // that will come in this batch, we notify. + if (finishedSubmitting_) { + gpuStats.numDepthThreadFinished++; + gpuStats.numDepthDraws += (int)depthDraws_.size(); + + // lock.unlock(); // possible optimization? + std::lock_guard flock(depthFinishMutex_); + finishedDrawing_ = true; + depthFinishCond_.notify_one(); + } + + // OK, wait for something to do. + depthEnqueueCond_.wait(lock); + } else { + _dbg_assert_(curDraw_ < depthDraws_.size()); + draw = depthDraws_[curDraw_++]; + hasDraw = true; + } + if (exitDepthThread_) { + break; + } + // Then just loop around and wait for the next event. + } + + // OK, now we *definitely* have a draw to process, and we're outside locks. Do it! + if (hasDraw) { + ProcessDepthDraw(draw); + } + } +} + void DrawEngineCommon::DepthRasterTransform(GEPrimitiveType prim, VertexDecoder *dec, uint32_t vertTypeID, int vertexCount) { if (!gstate.isModeClear() && (!gstate.isDepthTestEnabled() || !gstate.isDepthWriteEnabled())) { return; @@ -1042,13 +1185,7 @@ void DrawEngineCommon::DepthRasterTransform(GEPrimitiveType prim, VertexDecoder depthIndexCount_ += vertexCount; depthVertexCount_ += numDecoded; - if (depthDraws_.empty()) { - rasterTimeStart_ = time_now_d(); - } - - depthDraws_.push_back(draw); - - // FlushQueuedDepth(); + EnqueueDepthDraw(draw); } void DrawEngineCommon::DepthRasterPredecoded(GEPrimitiveType prim, const void *inVerts, int numDecoded, VertexDecoder *dec, int vertexCount) { @@ -1083,57 +1220,5 @@ void DrawEngineCommon::DepthRasterPredecoded(GEPrimitiveType prim, const void *i depthIndexCount_ += vertexCount; depthVertexCount_ += numDecoded; - depthDraws_.push_back(draw); - - if (depthDraws_.empty()) { - rasterTimeStart_ = time_now_d(); - } - // FlushQueuedDepth(); -} - -void DrawEngineCommon::FlushQueuedDepth() { - if (rasterTimeStart_ != 0.0) { - gpuStats.msRasterTimeAvailable += time_now_d() - rasterTimeStart_; - rasterTimeStart_ = 0.0; - } - - const bool collectStats = coreCollectDebugStats; - const bool lowQ = g_Config.iDepthRasterMode == (int)DepthRasterMode::LOW_QUALITY; - - for (const auto &draw : depthDraws_) { - int *tx = depthScreenVerts_; - int *ty = depthScreenVerts_ + DEPTH_SCREENVERTS_COMPONENT_COUNT; - float *tz = (float *)(depthScreenVerts_ + DEPTH_SCREENVERTS_COMPONENT_COUNT * 2); - - int outVertCount = 0; - - const float *vertices = depthTransformed_ + 4 * draw.vertexOffset; - const uint16_t *indices = depthIndices_ + draw.indexOffset; - - DepthScissor tileScissor = draw.scissor.Tile(0, 1); - - { - TimeCollector collectStat(&gpuStats.msCullDepth, collectStats); - switch (draw.prim) { - case GE_PRIM_RECTANGLES: - outVertCount = DepthRasterClipIndexedRectangles(tx, ty, tz, vertices, indices, draw, tileScissor); - break; - case GE_PRIM_TRIANGLES: - outVertCount = DepthRasterClipIndexedTriangles(tx, ty, tz, vertices, indices, draw, tileScissor); - break; - default: - _dbg_assert_(false); - break; - } - } - { - TimeCollector collectStat(&gpuStats.msRasterizeDepth, collectStats); - DepthRasterScreenVerts((uint16_t *)Memory::GetPointerWrite(draw.depthAddr), draw.depthStride, tx, ty, tz, outVertCount, draw, tileScissor, lowQ); - } - } - - // Reset queue - depthIndexCount_ = 0; - depthVertexCount_ = 0; - depthDraws_.clear(); + EnqueueDepthDraw(draw); } diff --git a/GPU/Common/DrawEngineCommon.h b/GPU/Common/DrawEngineCommon.h index e927a82e9a7e..b3ed41a34499 100644 --- a/GPU/Common/DrawEngineCommon.h +++ b/GPU/Common/DrawEngineCommon.h @@ -18,6 +18,8 @@ #pragma once #include +#include +#include #include "Common/CommonTypes.h" #include "Common/Data/Collections/Hashmaps.h" @@ -164,8 +166,6 @@ class DrawEngineCommon { return decoded_ + 12 * 65536; } - void FlushQueuedDepth(); - protected: virtual bool UpdateUseHWTessellation(bool enabled) const { return enabled; } void UpdatePlanes(); @@ -177,10 +177,6 @@ class DrawEngineCommon { void ApplyFramebufferRead(FBOTexState *fboTexState); - void DepthRasterTransform(GEPrimitiveType prim, VertexDecoder *dec, uint32_t vertTypeID, int vertexCount); - void DepthRasterPredecoded(GEPrimitiveType prim, const void *inVerts, int numDecoded, VertexDecoder *dec, int vertexCount); - bool CalculateDepthDraw(DepthDraw *draw, GEPrimitiveType prim, int vertexCount); - static inline int IndexSize(u32 vtype) { const u32 indexType = (vtype & GE_VTYPE_IDX_MASK); if (indexType == GE_VTYPE_IDX_16BIT) { @@ -216,7 +212,7 @@ class DrawEngineCommon { gpuStats.numVertsSubmitted += vertexCountInDrawCalls_; gpuStats.numVertsDecoded += numDecodedVerts_; - indexGen.Reset(); + indexGen_.Reset(); numDecodedVerts_ = 0; numDrawVerts_ = 0; numDrawInds_ = 0; @@ -333,7 +329,7 @@ class DrawEngineCommon { bool applySkinInDecode_ = false; // Vertex collector state - IndexGenerator indexGen; + IndexGenerator indexGen_; int numDecodedVerts_ = 0; GEPrimitiveType prevPrim_ = GE_PRIM_INVALID; @@ -346,19 +342,38 @@ class DrawEngineCommon { ComputedPipelineState pipelineState_; // Hardware tessellation - TessellationDataTransfer *tessDataTransfer; + TessellationDataTransfer *tessDataTransfer_ = nullptr; + + GPUCommon *gpuCommon_ = nullptr; // Culling +private: Plane8 planes_; Vec2f minOffset_; Vec2f maxOffset_; bool offsetOutsideEdge_; - GPUCommon *gpuCommon_; + // Software depth raster. TODO: Extract? +public: + // Public interface + void FlushQueuedDepth(); + +protected: + // Interface used by the backends. + void DepthRasterTransform(GEPrimitiveType prim, VertexDecoder *dec, uint32_t vertTypeID, int vertexCount); + void DepthRasterPredecoded(GEPrimitiveType prim, const void *inVerts, int numDecoded, VertexDecoder *dec, int vertexCount); - // Software depth raster bool useDepthRaster_ = false; +private: + // Internal implementation details. + void DepthThreadFunc(); + void WaitForDepthPassFinish(); + + inline void EnqueueDepthDraw(const DepthDraw &draw); + inline void ProcessDepthDraw(const DepthDraw &draw); + bool CalculateDepthDraw(DepthDraw *draw, GEPrimitiveType prim, int vertexCount); + float *depthTransformed_ = nullptr; int *depthScreenVerts_ = nullptr; uint16_t *depthIndices_ = nullptr; @@ -368,5 +383,18 @@ class DrawEngineCommon { int depthIndexCount_ = 0; std::vector depthDraws_; - double rasterTimeStart_ = 0.0; + double depthRasterPassStart_ = 0.0; + + std::thread depthThread_; + bool exitDepthThread_ = false; // notify depthEnqueueCond_ to check this. + + bool inDepthDrawPass_ = false; + std::mutex depthEnqueueMutex_; + std::condition_variable depthEnqueueCond_; + + bool finishedSubmitting_ = false; + bool finishedDrawing_ = false; + int curDraw_ = 0; + std::mutex depthFinishMutex_; + std::condition_variable depthFinishCond_; }; diff --git a/GPU/Common/SplineCommon.cpp b/GPU/Common/SplineCommon.cpp index 11a7a25439a7..496d574aec5a 100644 --- a/GPU/Common/SplineCommon.cpp +++ b/GPU/Common/SplineCommon.cpp @@ -552,7 +552,7 @@ void DrawEngineCommon::SubmitCurve(const void *control_points, const void *indic surface.Init(maxVerts); if (CanUseHardwareTessellation(surface.primType)) { - HardwareTessellation(output, surface, origVertType, points, tessDataTransfer); + HardwareTessellation(output, surface, origVertType, points, tessDataTransfer_); } else { ControlPoints cpoints(points, num_points, managedBuf); if (cpoints.IsValid()) diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index a1238172bd2c..2fe34cf0384f 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -82,7 +82,7 @@ void DrawEngineD3D11::InitDeviceObjects() { pushInds_ = new PushBufferD3D11(device_, INDEX_PUSH_SIZE, D3D11_BIND_INDEX_BUFFER); tessDataTransferD3D11 = new TessellationDataTransferD3D11(context_, device_); - tessDataTransfer = tessDataTransferD3D11; + tessDataTransfer_ = tessDataTransferD3D11; draw_->SetInvalidationCallback(std::bind(&DrawEngineD3D11::Invalidate, this, std::placeholders::_1)); } @@ -108,7 +108,7 @@ void DrawEngineD3D11::DestroyDeviceObjects() { ClearInputLayoutMap(); delete tessDataTransferD3D11; tessDataTransferD3D11 = nullptr; - tessDataTransfer = nullptr; + tessDataTransfer_ = nullptr; delete pushVerts_; delete pushInds_; depthStencilCache_.Iterate([&](const uint64_t &key, ID3D11DepthStencilState *ds) { diff --git a/GPU/Directx9/DrawEngineDX9.cpp b/GPU/Directx9/DrawEngineDX9.cpp index e6d7d3ab514b..cb6debe717e4 100644 --- a/GPU/Directx9/DrawEngineDX9.cpp +++ b/GPU/Directx9/DrawEngineDX9.cpp @@ -84,7 +84,7 @@ DrawEngineDX9::DrawEngineDX9(Draw::DrawContext *draw) : draw_(draw), vertexDeclM InitDeviceObjects(); tessDataTransferDX9 = new TessellationDataTransferDX9(); - tessDataTransfer = tessDataTransferDX9; + tessDataTransfer_ = tessDataTransferDX9; device_->CreateVertexDeclaration(TransformedVertexElements, &transformedVertexDecl_); } diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index 42fed50d2ea3..5ff5d3596e34 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -59,7 +59,7 @@ DrawEngineGLES::DrawEngineGLES(Draw::DrawContext *draw) : inputLayoutMap_(16), d InitDeviceObjects(); tessDataTransferGLES = new TessellationDataTransferGLES(render_); - tessDataTransfer = tessDataTransferGLES; + tessDataTransfer_ = tessDataTransferGLES; } DrawEngineGLES::~DrawEngineGLES() { @@ -231,7 +231,7 @@ void DrawEngineGLES::Flush() { // Something went badly wrong. Try to survive by simply skipping the draw, though. _dbg_assert_msg_(false, "Trying to DoFlush while not in a render pass. This is bad."); // can't goto bail here, skips too many variable initializations. So let's wipe the most important stuff. - indexGen.Reset(); + indexGen_.Reset(); numDecodedVerts_ = 0; numDrawVerts_ = 0; numDrawInds_ = 0; diff --git a/GPU/GPU.h b/GPU/GPU.h index 506f0d9c38c4..f7d278618a75 100644 --- a/GPU/GPU.h +++ b/GPU/GPU.h @@ -118,6 +118,9 @@ struct GPUStatistics { numDepthRasterTooSmall = 0; numDepthRasterZCulled = 0; numDepthEarlyBoxCulled = 0; + numDepthThreadCaughtUp = 0; + numDepthThreadFinished = 0; + numDepthDraws = 0; vertexGPUCycles = 0; otherGPUCycles = 0; } @@ -169,6 +172,9 @@ struct GPUStatistics { int numDepthRasterTooSmall; int numDepthRasterZCulled; int numDepthEarlyBoxCulled; + int numDepthThreadCaughtUp; + int numDepthThreadFinished; + int numDepthDraws; // Flip count. Doesn't really belong here. int numFlips; }; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index a58d5c3e284f..d915550236a3 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -1802,7 +1802,9 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) { "Cpy: depth %d, color %d, reint %d, blend %d, self %d\n" "GPU cycles: %d (%0.1f per vertex)\n" "Z-rast: %0.2f+%0.2f+%0.2f (total %0.2f/%0.2f) ms\n" - "Z-rast: %d prim, %d nopix, %d small, %d earlysize, %d zcull, %d box\n%s", + "Z-rast: %d prim, %d nopix, %d small, %d earlysize, %d zcull, %d box\n" + "Z-rast: %d draws, %d thread caught up, %d thread finishes\n" + "%s", gpuStats.msProcessingDisplayLists * 1000.0f, gpuStats.numDrawSyncs, gpuStats.numListSyncs, @@ -1850,6 +1852,9 @@ size_t GPUCommonHW::FormatGPUStatsCommon(char *buffer, size_t size) { gpuStats.numDepthRasterEarlySize, gpuStats.numDepthRasterZCulled, gpuStats.numDepthEarlyBoxCulled, + gpuStats.numDepthDraws, + gpuStats.numDepthThreadCaughtUp, + gpuStats.numDepthThreadFinished, debugRecording_ ? "(debug-recording)" : "" ); } diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index a456b5d72c31..80f1410c7e64 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -94,7 +94,7 @@ void DrawEngineVulkan::InitDeviceObjects() { _dbg_assert_(VK_SUCCESS == res); tessDataTransferVulkan = new TessellationDataTransferVulkan(vulkan); - tessDataTransfer = tessDataTransferVulkan; + tessDataTransfer_ = tessDataTransferVulkan; draw_->SetInvalidationCallback(std::bind(&DrawEngineVulkan::Invalidate, this, std::placeholders::_1)); } @@ -115,7 +115,7 @@ void DrawEngineVulkan::DestroyDeviceObjects() { draw_->SetInvalidationCallback(InvalidationCallback()); delete tessDataTransferVulkan; - tessDataTransfer = nullptr; + tessDataTransfer_ = nullptr; tessDataTransferVulkan = nullptr; pushUBO_ = nullptr; @@ -577,7 +577,7 @@ void DrawEngineVulkan::Flush() { } void DrawEngineVulkan::ResetAfterDraw() { - indexGen.Reset(); + indexGen_.Reset(); numDecodedVerts_ = 0; numDrawVerts_ = 0; numDrawInds_ = 0;