[GPU] Add a comment about non-positive tessellation factors

This commit is contained in:
Triang3l 2020-10-19 23:02:20 +03:00
parent 9081046e7b
commit ca9086f3ba
2 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,11 @@ XeHSConstantDataOutput XePatchConstant(
// [2] - between U1V1 and U0V1. // [2] - between U1V1 and U0V1.
// [3] - between U0V1 and U0V0. // [3] - between U0V1 and U0V0.
[unroll] for (i = 0u; i < 4u; ++i) { [unroll] for (i = 0u; i < 4u; ++i) {
// While Viva Pinata sets the factors to 0 for frustum-culled (quad)
// patches, in Halo 3 only allowing patches with factors above 0 makes
// distant (triangle) patches disappear - it appears that there are no
// special values for culled patches on the Xbox 360 (unlike 0 and NaN on
// Direct3D 11).
output.edges[i] = clamp( output.edges[i] = clamp(
asfloat(xe_input_patch[(i + 3u) & 3u].index_or_edge_factor) + 1.0f, asfloat(xe_input_patch[(i + 3u) & 3u].index_or_edge_factor) + 1.0f,
xe_tessellation_factor_range.x, xe_tessellation_factor_range.y); xe_tessellation_factor_range.x, xe_tessellation_factor_range.y);

View File

@ -38,6 +38,11 @@ XeHSConstantDataOutput XePatchConstant(
// 3) r0.z * v0 + r0.y * v1 + r0.x * v2 by the guest. // 3) r0.z * v0 + r0.y * v1 + r0.x * v2 by the guest.
// With this order, there are no cracks in Halo 3 water. // With this order, there are no cracks in Halo 3 water.
[unroll] for (i = 0u; i < 3u; ++i) { [unroll] for (i = 0u; i < 3u; ++i) {
// While Viva Pinata sets the factors to 0 for frustum-culled (quad)
// patches, in Halo 3 only allowing patches with factors above 0 makes
// distant (triangle) patches disappear - it appears that there are no
// special values for culled patches on the Xbox 360 (unlike 0 and NaN on
// Direct3D 11).
output.edges[i] = clamp( output.edges[i] = clamp(
asfloat(xe_input_patch[(i + 1u) % 3u].index_or_edge_factor) + 1.0f, asfloat(xe_input_patch[(i + 1u) % 3u].index_or_edge_factor) + 1.0f,
xe_tessellation_factor_range.x, xe_tessellation_factor_range.y); xe_tessellation_factor_range.x, xe_tessellation_factor_range.y);