[GPU] Polygon offset scale factor in xenos.h

This commit is contained in:
Triang3l
2021-06-09 20:46:24 +03:00
parent 9e6aec4535
commit 50bb35b4b4
4 changed files with 18 additions and 6 deletions

View File

@@ -3241,9 +3241,10 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
poly_offset_back_offset = poly_offset_front_offset;
}
}
// "slope computed in subpixels ([...] 1/16)" - R5xx Acceleration.
poly_offset_front_scale *= (1.0f / 16.0f) * resolution_scale;
poly_offset_back_scale *= (1.0f / 16.0f) * resolution_scale;
float poly_offset_scale_factor =
xenos::kPolygonOffsetScaleSubpixelUnit * resolution_scale;
poly_offset_front_scale *= poly_offset_scale_factor;
poly_offset_back_scale *= poly_offset_scale_factor;
dirty |= system_constants_.edram_poly_offset_front_scale !=
poly_offset_front_scale;
system_constants_.edram_poly_offset_front_scale = poly_offset_front_scale;