From fef50f5348f105c3104af9760d6e02f8943d34da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 16 Jul 2026 17:52:14 +0200 Subject: [PATCH] Remove obsolete software transform vertex decoder hack that forced software skinning --- GPU/D3D11/DrawEngineD3D11.cpp | 16 ++++------------ GPU/GLES/DrawEngineGLES.cpp | 13 +++---------- GPU/Vulkan/DrawEngineVulkan.cpp | 17 +++++------------ 3 files changed, 12 insertions(+), 34 deletions(-) diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index 476e0ea860..bd6308d9d3 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -387,15 +387,7 @@ void DrawEngineD3D11::Flush() { } } else { PROFILE_THIS_SCOPE("soft"); - const VertexDecoder *swDec = dec_; - if (swDec->nweights != 0) { - u32 withSkinning = lastVType_ | (1 << 26); - if (withSkinning != lastVType_) { - swDec = GetVertexDecoder(withSkinning); - } - } - - DecodeVerts(swDec, decoded_); + DecodeVerts(dec_, decoded_); int vertexCount = DecodeInds(); bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE; @@ -420,7 +412,7 @@ void DrawEngineD3D11::Flush() { // We could piggyback on the viewport transform below, but it gets complicated since it's different per-backend. Which we really // should clean up one day... if (useDepthRaster_) { - DepthRasterPredecoded(prim, decoded_, numDecodedVerts_, swDec, vertexCount); + DepthRasterPredecoded(prim, decoded_, numDecodedVerts_, dec_, vertexCount); } SoftwareTransformResult result{}; @@ -433,7 +425,7 @@ void DrawEngineD3D11::Flush() { params.allowSeparateAlphaClear = false; // D3D11 doesn't support separate alpha clears params.clipInfoFlags = clipInfoFlags_; - const SoftwareTransformAction action = RunSoftwareTransform(params, prim, swDec->VertexType(), swDec->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result); + const SoftwareTransformAction action = RunSoftwareTransform(params, prim, dec_->VertexType(), dec_->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result); if (result.setSafeSize) { framebufferManager_->SetSafeSize(result.safeWidth, result.safeHeight); } @@ -451,7 +443,7 @@ void DrawEngineD3D11::Flush() { if (action == SW_DRAW_INDEXED) { D3D11VertexShader *vshader; D3D11FragmentShader *fshader; - shaderManager_->GetShaders(prim, swDec->VertexType(), &vshader, &fshader, pipelineState_, false, clipInfoFlags_); + shaderManager_->GetShaders(prim, dec_->VertexType(), &vshader, &fshader, pipelineState_, false, clipInfoFlags_); context_->PSSetShader(fshader->GetShader(), nullptr, 0); context_->VSSetShader(vshader->GetShader(), nullptr, 0); shaderManager_->UpdateUniforms(framebufferManager_->UseBufferedRendering(), result.pixelMapped); diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index 6bec716f00..e248f18c8c 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -339,14 +339,7 @@ void DrawEngineGLES::Flush() { } } else { PROFILE_THIS_SCOPE("soft"); - const VertexDecoder *swDec = dec_; - if (swDec->nweights != 0) { - u32 withSkinning = lastVType_ | (1 << 26); - if (withSkinning != lastVType_) { - swDec = GetVertexDecoder(withSkinning); - } - } - DecodeVerts(swDec, decoded_); + DecodeVerts(dec_, decoded_); int vertexCount = DecodeInds(); bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE; @@ -373,7 +366,7 @@ void DrawEngineGLES::Flush() { // We could piggyback on the viewport transform below, but it gets complicated since it's different per-backend. Which we really // should clean up one day... if (useDepthRaster_) { - DepthRasterPredecoded(prim, decoded_, numDecodedVerts_, swDec, vertexCount); + DepthRasterPredecoded(prim, decoded_, numDecodedVerts_, dec_, vertexCount); } u16 *inds = decIndex_; @@ -387,7 +380,7 @@ void DrawEngineGLES::Flush() { params.allowSeparateAlphaClear = true; params.clipInfoFlags = clipInfoFlags_; - const SoftwareTransformAction action = RunSoftwareTransform(params, prim, swDec->VertexType(), swDec->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result); + const SoftwareTransformAction action = RunSoftwareTransform(params, prim, dec_->VertexType(), dec_->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result); if (result.setSafeSize) { framebufferManager_->SetSafeSize(result.safeWidth, result.safeHeight); } diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index 979125660b..8a10e15661 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -374,16 +374,9 @@ void DrawEngineVulkan::Flush() { gpuStats.perFrame.numSoftTransformedDraws++; PROFILE_THIS_SCOPE("soft"); - const VertexDecoder *swDec = dec_; - if (swDec->nweights != 0) { - u32 withSkinning = lastVType_ | (1 << 26); - if (withSkinning != lastVType_) { - swDec = GetVertexDecoder(withSkinning); - } - } int prevDecodedVerts = numDecodedVerts_; - DecodeVerts(swDec, decoded_); + DecodeVerts(dec_, decoded_); int vertexCount = DecodeInds(); bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE; @@ -402,7 +395,7 @@ void DrawEngineVulkan::Flush() { // We could piggyback on the viewport transform below, but it gets complicated since it's different per-backend. Which we really // should clean up one day... if (useDepthRaster_) { - DepthRasterPredecoded(prim, decoded_, numDecodedVerts_, swDec, vertexCount); + DepthRasterPredecoded(prim, decoded_, numDecodedVerts_, dec_, vertexCount); } u16 *inds = decIndex_; @@ -427,7 +420,7 @@ void DrawEngineVulkan::Flush() { params.everUsedEqualDepth = everUsedEqualDepth_; params.clipInfoFlags = clipInfoFlags_; - const SoftwareTransformAction action = RunSoftwareTransform(params, prim, swDec->VertexType(), swDec->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result); + const SoftwareTransformAction action = RunSoftwareTransform(params, prim, dec_->VertexType(), dec_->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result); if (result.setSafeSize) { framebufferManager_->SetSafeSize(result.safeWidth, result.safeHeight); } @@ -456,9 +449,9 @@ void DrawEngineVulkan::Flush() { VShaderID vshaderID; FShaderID fshaderID; - shaderManager_->GetShaderIDs(prim, swDec->VertexType(), &vshaderID, &fshaderID, pipelineState_, false, clipInfoFlags_); + shaderManager_->GetShaderIDs(prim, dec_->VertexType(), &vshaderID, &fshaderID, pipelineState_, false, clipInfoFlags_); _dbg_assert_msg_(vshaderID.Bit(VS_BIT_USE_HW_TRANSFORM) == false, "Bad vshader ID"); - VulkanPipeline *pipeline = pipelineManager_->GetOrCreatePipeline(renderManager, shaderManager_, pipelineLayout_, pipelineKey_, &swDec->decFmt, vshaderID, fshaderID, false, 0, framebufferManager_->GetMSAALevel(), false); + VulkanPipeline *pipeline = pipelineManager_->GetOrCreatePipeline(renderManager, shaderManager_, pipelineLayout_, pipelineKey_, &dec_->decFmt, vshaderID, fshaderID, false, 0, framebufferManager_->GetMSAALevel(), false); if (!pipeline || !pipeline->pipeline) { // Already logged, let's bail out. ResetAfterSkippedDraw();