Enable depth raster in all backends, not just Vulkan

This commit is contained in:
Henrik Rydgård
2024-12-24 23:25:40 +01:00
parent 032f51988d
commit 4aaea67766
3 changed files with 30 additions and 0 deletions
+10
View File
@@ -335,6 +335,9 @@ void DrawEngineD3D11::Flush() {
context_->Draw(vertexCount, 0);
}
}
if (useDepthRaster_) {
DepthRasterTransform(prim, dec_, dec_->VertexType(), vertexCount);
}
} else {
PROFILE_THIS_SCOPE("soft");
VertexDecoder *swDec = dec_;
@@ -388,6 +391,13 @@ void DrawEngineD3D11::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);
+10
View File
@@ -292,6 +292,9 @@ void DrawEngineDX9::Flush() {
}
}
}
if (useDepthRaster_) {
DepthRasterTransform(prim, dec_, dec_->VertexType(), vertexCount);
}
} else {
VertexDecoder *swDec = dec_;
if (swDec->nweights != 0) {
@@ -344,6 +347,13 @@ void DrawEngineDX9::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);
}
int maxIndex = numDecodedVerts_;
SoftwareTransform swTransform(params);
+10
View File
@@ -315,6 +315,9 @@ void DrawEngineGLES::Flush() {
inputLayout, vertexBuffer, vertexBufferOffset,
glprim[prim], 0, vertexCount);
}
if (useDepthRaster_) {
DepthRasterTransform(prim, dec_, dec_->VertexType(), vertexCount);
}
} else {
PROFILE_THIS_SCOPE("soft");
VertexDecoder *swDec = dec_;
@@ -371,6 +374,13 @@ void DrawEngineGLES::Flush() {
}
}
// 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);