From e0634f3df9f39cd7ed00bd8efa5db2f439102f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 13 Jun 2026 10:42:00 +0200 Subject: [PATCH] Assorted cleanup and tweaks --- Common/GPU/Vulkan/VulkanRenderManager.cpp | 7 ++-- Core/MIPS/ARM/ArmJit.h | 40 ----------------------- GPU/Common/VertexDecoderHandwritten.cpp | 4 +-- GPU/D3D11/DrawEngineD3D11.cpp | 4 +-- GPU/GLES/DrawEngineGLES.cpp | 3 +- GPU/GPU.h | 2 +- GPU/GPUCommonHW.cpp | 2 +- GPU/Vulkan/DrawEngineVulkan.cpp | 3 +- android/build.gradle.kts | 2 ++ 9 files changed, 15 insertions(+), 52 deletions(-) diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 10abc5cbec..60d3690f6e 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -977,10 +977,9 @@ void VulkanRenderManager::EndCurRenderStep() { } } - compileQueueMutex_.lock(); - if (needsCompile) + if (needsCompile) { compileCond_.notify_one(); - compileQueueMutex_.unlock(); + } pipelinesToCheck_.clear(); // We don't do this optimization for very small targets, probably not worth it. @@ -1865,7 +1864,7 @@ void VKRPipelineLayout::FlushDescSets(VulkanContext *vulkan, int frame, QueuePro pool.Reset(); - VkDescriptorSet setCache[8]; + VkDescriptorSet setCache[16]; VkDescriptorSetLayout layoutsForAlloc[ARRAY_SIZE(setCache)]; for (int i = 0; i < ARRAY_SIZE(setCache); i++) { layoutsForAlloc[i] = descriptorSetLayout; diff --git a/Core/MIPS/ARM/ArmJit.h b/Core/MIPS/ARM/ArmJit.h index aeaa355d42..cc7ef2907d 100644 --- a/Core/MIPS/ARM/ArmJit.h +++ b/Core/MIPS/ARM/ArmJit.h @@ -128,46 +128,6 @@ public: void Comp_ColorConv(MIPSOpcode op) override; void Comp_Vbfy(MIPSOpcode op) override; - // Non-NEON: VPFX - - // NEON implementations of the VFPU ops. - void CompNEON_SV(MIPSOpcode op); - void CompNEON_SVQ(MIPSOpcode op); - void CompNEON_VVectorInit(MIPSOpcode op); - void CompNEON_VMatrixInit(MIPSOpcode op); - void CompNEON_VDot(MIPSOpcode op); - void CompNEON_VecDo3(MIPSOpcode op); - void CompNEON_VV2Op(MIPSOpcode op); - void CompNEON_Mftv(MIPSOpcode op); - void CompNEON_Vmfvc(MIPSOpcode op); - void CompNEON_Vmtvc(MIPSOpcode op); - void CompNEON_Vmmov(MIPSOpcode op); - void CompNEON_VScl(MIPSOpcode op); - void CompNEON_Vmmul(MIPSOpcode op); - void CompNEON_Vmscl(MIPSOpcode op); - void CompNEON_Vtfm(MIPSOpcode op); - void CompNEON_VHdp(MIPSOpcode op); - void CompNEON_VCrs(MIPSOpcode op); - void CompNEON_VDet(MIPSOpcode op); - void CompNEON_Vi2x(MIPSOpcode op); - void CompNEON_Vx2i(MIPSOpcode op); - void CompNEON_Vf2i(MIPSOpcode op); - void CompNEON_Vi2f(MIPSOpcode op); - void CompNEON_Vh2f(MIPSOpcode op); - void CompNEON_Vcst(MIPSOpcode op); - void CompNEON_Vhoriz(MIPSOpcode op); - void CompNEON_VRot(MIPSOpcode op); - void CompNEON_VIdt(MIPSOpcode op); - void CompNEON_Vcmp(MIPSOpcode op); - void CompNEON_Vcmov(MIPSOpcode op); - void CompNEON_Viim(MIPSOpcode op); - void CompNEON_Vfim(MIPSOpcode op); - void CompNEON_VCrossQuat(MIPSOpcode op); - void CompNEON_Vsgn(MIPSOpcode op); - void CompNEON_Vocp(MIPSOpcode op); - void CompNEON_ColorConv(MIPSOpcode op); - void CompNEON_Vbfy(MIPSOpcode op); - int Replace_fabsf() override; JitBlockCache *GetBlockCache() override { return &blocks; } diff --git a/GPU/Common/VertexDecoderHandwritten.cpp b/GPU/Common/VertexDecoderHandwritten.cpp index efa3a957c1..7caaf36754 100644 --- a/GPU/Common/VertexDecoderHandwritten.cpp +++ b/GPU/Common/VertexDecoderHandwritten.cpp @@ -177,14 +177,14 @@ void VtxDec_Tu8_C5551_Ps16(const u8 *srcp, u8 *dstp, int numVerts, const UVScale __m128 pos0_ext = _mm_mul_ps(_mm_cvtepi32_ps(pos0_32), posScale); __m128 pos1_ext = _mm_mul_ps(_mm_cvtepi32_ps(pos1_32), posScale); - __m128i uv8 = _mm_set1_epi32(uv0); + __m128i uv8 = _mm_cvtsi32_si128(uv0); __m128i uv16 = _mm_unpacklo_epi8(uv8, uv8); __m128i uv32 = _mm_srli_epi32(_mm_unpacklo_epi16(uv16, uv16), 24); __m128d uvf = _mm_castps_pd(_mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(uv32), uvScale), uvOff)); alpha &= col0; // Combined 5551 -> 8888 RGBA. Nasty. - __m128i col = _mm_set1_epi64x(col0); + __m128i col = _mm_cvtsi64_si128(col0); __m128i r = _mm_slli_epi32(_mm_and_si128(col, rmask), 8 - 5); __m128i g = _mm_slli_epi32(_mm_and_si128(col, gmask), 16 - 10); __m128i b = _mm_slli_epi32(_mm_and_si128(col, bmask), 24 - 15); diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index 223830822f..c1a67cdc12 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -324,7 +324,7 @@ void DrawEngineD3D11::Flush() { bool useElements; DecodeVerts(dec_, decoded_); DecodeIndsAndGetData(&prim, &vertexCount, &maxIndex, &useElements, false); - gpuStats.perFrame.numUncachedVertsDrawn += vertexCount; + gpuStats.perFrame.numVertsDrawn += vertexCount; bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE; if (gstate.isModeThrough()) { @@ -412,7 +412,6 @@ void DrawEngineD3D11::Flush() { gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255); } - gpuStats.perFrame.numUncachedVertsDrawn += vertexCount; prim = IndexGenerator::GeneralPrim((GEPrimitiveType)drawInds_[0].prim); VERBOSE_LOG(Log::G3D, "Flush prim %i SW! %i verts in one go", prim, vertexCount); @@ -492,6 +491,7 @@ void DrawEngineD3D11::Flush() { pushInds_->EndPush(context_); context_->IASetIndexBuffer(pushInds_->Buf(), DXGI_FORMAT_R16_UINT, iOffset); context_->DrawIndexed(result.drawIndexCount, 0, 0); + gpuStats.perFrame.numVertsDrawn += result.drawIndexCount; } else if (action == SW_CLEAR) { u32 clearColor = result.color; float clearDepth = result.depth; diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index f54b24fe19..5bd549cf07 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -303,6 +303,7 @@ void DrawEngineGLES::Flush() { bool useElements; DecodeVerts(dec_, decoded_); DecodeIndsAndGetData(&prim, &vertexCount, &maxIndex, &useElements, false); + gpuStats.perFrame.numVertsDrawn += vertexCount; if (useElements) { uint32_t esz = sizeof(uint16_t) * vertexCount; @@ -361,7 +362,6 @@ void DrawEngineGLES::Flush() { gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255); } - gpuStats.perFrame.numUncachedVertsDrawn += vertexCount; prim = IndexGenerator::GeneralPrim((GEPrimitiveType)drawInds_[0].prim); int maxIndex = numDecodedVerts_; @@ -424,6 +424,7 @@ void DrawEngineGLES::Flush() { render_->DrawIndexed( softwareInputLayout_, vertexBuffer, vertexBufferOffset, indexBuffer, indexBufferOffset, glprim[prim], result.drawIndexCount, GL_UNSIGNED_SHORT); + gpuStats.perFrame.numVertsDrawn += result.drawIndexCount; } else if (action == SW_CLEAR) { u32 clearColor = result.color; float clearDepth = result.depth; diff --git a/GPU/GPU.h b/GPU/GPU.h index 7a7391239f..f533832fbb 100644 --- a/GPU/GPU.h +++ b/GPU/GPU.h @@ -104,7 +104,7 @@ struct GPUStatsPerFrame { int numBBOXJumps; int numVertsSubmitted; int numVertsDecoded; - int numUncachedVertsDrawn; + int numVertsDrawn; int numTextureInvalidations; int numTexturesChanged; int numTextureInvalidationsByFramebuffer; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 3d9a81a6e1..84323c66a1 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -1819,7 +1819,7 @@ void GPUCommonHW::FormatGPUStatsCommon(StringWriter &w) { gpuStats.perFrame.numSoftTransformedDraws, gpuStats.perFrame.numVertsSubmitted, gpuStats.perFrame.numVertsDecoded, - gpuStats.perFrame.numUncachedVertsDrawn, + gpuStats.perFrame.numVertsDrawn, gpuStats.perFrame.numSoftClippedTriangles, (int)framebufferManager_->NumVFBs(), gpuStats.perFrame.numFramebufferEvaluations, diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index 3b2293e89d..9e74f06b9e 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -292,6 +292,7 @@ void DrawEngineVulkan::Flush() { int maxIndex; bool useElements; DecodeIndsAndGetData(&prim, &vertexCount, &maxIndex, &useElements, false); + gpuStats.perFrame.numVertsDrawn += vertexCount; bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE; if (gstate.isModeThrough()) { @@ -420,7 +421,7 @@ void DrawEngineVulkan::Flush() { gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255); } - gpuStats.perFrame.numUncachedVertsDrawn += vertexCount; + gpuStats.perFrame.numVertsDrawn += vertexCount; prim = IndexGenerator::GeneralPrim((GEPrimitiveType)drawInds_[0].prim); // At this point, the output is always an indexed triangle/line/point list, no strips/fans. diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 76dbddd1bd..fff8ba2d8b 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -140,6 +140,7 @@ android { } buildTypes { getByName("debug") { + isDefault = true isMinifyEnabled = false isJniDebuggable = true signingConfig = signingConfigs.getByName("debug") @@ -191,6 +192,7 @@ android { } productFlavors { create("normal") { + isDefault = true applicationId = "org.ppsspp.ppsspp" dimension = "variant" externalNativeBuild {