diff --git a/GPU/Common/ShaderUniforms.cpp b/GPU/Common/ShaderUniforms.cpp index e5acc7bc27..82cdc70b33 100644 --- a/GPU/Common/ShaderUniforms.cpp +++ b/GPU/Common/ShaderUniforms.cpp @@ -15,7 +15,7 @@ static void ConvertProjMatrixToVulkan(Matrix4x4 &in) { static void ConvertProjMatrixToD3D11(Matrix4x4 &in) { const Vec3 trans(0, 0, gstate_c.vpZOffset * 0.5f + 0.5f); - const Vec3 scale(gstate_c.vpWidthScale, gstate_c.vpHeightScale, gstate_c.vpDepthScale * 0.5f); + const Vec3 scale(gstate_c.vpWidthScale, -gstate_c.vpHeightScale, gstate_c.vpDepthScale * 0.5f); in.translateAndScale(trans, scale); } diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index a03cdc6139..d136b93822 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -772,6 +772,8 @@ rotateVBO: ID3D11InputLayout *inputLayout = SetupDecFmtForDraw(vshader, dec_->GetDecVtxFmt(), dec_->VertexType()); context_->PSSetShader(fshader->GetShader(), nullptr, 0); context_->VSSetShader(vshader->GetShader(), nullptr, 0); + shaderManager_->UpdateUniforms(); + shaderManager_->BindUniforms(); context_->IASetInputLayout(inputLayout); UINT stride = dec_->GetDecVtxFmt().stride; diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 3fbe3479d7..77c89f036f 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -1137,10 +1137,12 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture & gpuStats.numTexturesDecoded++; // For UpdateSubresource, we can't decode directly into the texture so we allocate a buffer :( - u32 *mapData = new u32[w * h]{}; - int mapRowPitch = w * 4; + u32 *mapData; + int mapRowPitch; if (replaced.GetSize(level, w, h)) { + mapData = new u32[w * h]{}; + mapRowPitch = w * 4; replaced.Load(level, mapData, mapRowPitch); dstFmt = ToDXGIFormat(replaced.Format(level)); } else { @@ -1149,6 +1151,8 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture & u32 texaddr = gstate.getTextureAddress(level); int bufw = GetTextureBufw(level, texaddr, tfmt); int bpp = dstFmt == DXGI_FORMAT_R8G8B8A8_UNORM ? 4 : 2; + mapRowPitch = std::max(bufw, w) * 4; + mapData = new u32[mapRowPitch / 4 * h]{}; u32 *pixelData = (u32 *)mapData; int decPitch = mapRowPitch;