mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 17:53:42 +01:00
Rework depth raster to fully support software transform
This commit is contained in:
1 parent
bd3a252104
commit
2371fdfedd
5 files changed
+148
-30
No files matched your search
@@ -434,6 +434,13 @@ void DrawEngineVulkan::Flush() {
|
||||
UpdateCachedViewportState(vpAndScissor);
|
||||
}
|
||||
|
||||
// At this point, rect and line primitives are still preserved as such. So, it's the best time to do software depth raster.
|
||||
// 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);
|
||||
}
|
||||
|
||||
SoftwareTransform swTransform(params);
|
||||
|
||||
const Lin::Vec3 trans(gstate_c.vpXOffset, gstate_c.vpYOffset, gstate_c.vpZOffset * 0.5f + 0.5f);
|
||||
@@ -442,11 +449,6 @@ void DrawEngineVulkan::Flush() {
|
||||
|
||||
swTransform.Transform(prim, swDec->VertexType(), swDec->GetDecVtxFmt(), numDecodedVerts_, &result);
|
||||
|
||||
// At this point, rect and line primitives are still preserved as such. So, it's the best time to do software depth raster.
|
||||
if (useDepthRaster_) {
|
||||
DepthRasterPretransformed(prim, transformed_, numDecodedVerts_);
|
||||
}
|
||||
|
||||
// Non-zero depth clears are unusual, but some drivers don't match drawn depth values to cleared values.
|
||||
// Games sometimes expect exact matches (see #12626, for example) for equal comparisons.
|
||||
if (result.action == SW_CLEAR && everUsedEqualDepth_ && gstate.isClearModeDepthMask() && result.depth > 0.0f && result.depth < 1.0f)
|
||||
|
||||
Reference in new issue
Block a user