[GPU] Fix adaptive quad tessellation inside factors

This commit is contained in:
Triang3l 2020-10-27 21:01:55 +03:00
parent 2b8f347b0b
commit 9bbe4365d1
4 changed files with 31 additions and 26 deletions

View File

@ -39,11 +39,13 @@ XeHSConstantDataOutput XePatchConstant(
xe_tessellation_factor_range.x, xe_tessellation_factor_range.y);
}
// On the Xbox 360, according to the presentation, the inside factor is the
// minimum of the factors of the edges along the axis.
// Direct3D 12:
// [0] - along U.
// [1] - along V.
output.inside[0u] = min(output.edges[0u], output.edges[2u]);
output.inside[1u] = min(output.edges[1u], output.edges[3u]);
output.inside[0u] = min(output.edges[1u], output.edges[3u]);
output.inside[1u] = min(output.edges[0u], output.edges[2u]);
return output;
}

View File

@ -1,11 +1,11 @@
// generated from `xb buildhlsl`
// source: adaptive_quad.hs.hlsl
const uint8_t adaptive_quad_hs[] = {
0x44, 0x58, 0x42, 0x43, 0x09, 0x4F, 0xBB, 0x85, 0xF4, 0xA9, 0x5A, 0x24,
0x49, 0x56, 0x0F, 0x66, 0x0D, 0xF9, 0x1F, 0xFD, 0x01, 0x00, 0x00, 0x00,
0x38, 0x0F, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
0x44, 0x58, 0x42, 0x43, 0x69, 0x9E, 0x19, 0x65, 0x4D, 0x36, 0x4D, 0x06,
0xF1, 0xC9, 0xBB, 0xA5, 0x8A, 0x00, 0x59, 0x9E, 0x01, 0x00, 0x00, 0x00,
0x54, 0x0F, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
0xD4, 0x0A, 0x00, 0x00, 0x08, 0x0B, 0x00, 0x00, 0x3C, 0x0B, 0x00, 0x00,
0x00, 0x0C, 0x00, 0x00, 0x9C, 0x0E, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46,
0x00, 0x0C, 0x00, 0x00, 0xB8, 0x0E, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46,
0x94, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x01, 0x05, 0x53, 0x48,
0x00, 0x05, 0x00, 0x00, 0x6A, 0x0A, 0x00, 0x00, 0x13, 0x13, 0x44, 0x25,
@ -257,8 +257,8 @@ const uint8_t adaptive_quad_hs[] = {
0x53, 0x56, 0x5F, 0x54, 0x65, 0x73, 0x73, 0x46, 0x61, 0x63, 0x74, 0x6F,
0x72, 0x00, 0x53, 0x56, 0x5F, 0x49, 0x6E, 0x73, 0x69, 0x64, 0x65, 0x54,
0x65, 0x73, 0x73, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x00, 0xAB, 0xAB,
0x53, 0x48, 0x45, 0x58, 0x94, 0x02, 0x00, 0x00, 0x51, 0x00, 0x03, 0x00,
0xA5, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x01, 0x93, 0x20, 0x00, 0x01,
0x53, 0x48, 0x45, 0x58, 0xB0, 0x02, 0x00, 0x00, 0x51, 0x00, 0x03, 0x00,
0xAC, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x01, 0x93, 0x20, 0x00, 0x01,
0x94, 0x20, 0x00, 0x01, 0x95, 0x18, 0x00, 0x01, 0x96, 0x20, 0x00, 0x01,
0x97, 0x18, 0x00, 0x01, 0x6A, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x07,
0x46, 0x8E, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -305,25 +305,27 @@ const uint8_t adaptive_quad_hs[] = {
0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x04,
0x12, 0x20, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x5B, 0x00, 0x00, 0x04, 0x12, 0xB0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x04, 0x12, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0A, 0x80, 0x01, 0x00, 0x33, 0x00, 0x00, 0x0A,
0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xB0, 0x91, 0x00,
0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0A, 0x80, 0x01, 0x80, 0x41, 0x00, 0x00, 0x00,
0x01, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x0A,
0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xB0, 0x91, 0x00,
0x0A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xB0, 0xD1, 0x00,
0x02, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x36, 0x00, 0x00, 0x07, 0x12, 0x20, 0xD0, 0x00, 0x04, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54,
0x94, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x36, 0x00, 0x00, 0x04, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x80, 0x01, 0x00, 0x36, 0x00, 0x00, 0x07, 0x12, 0x20, 0xD0, 0x00,
0x04, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x01,
0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

View File

@ -127,8 +127,9 @@ dcl_output_siv o5.x, finalQuadVInsideTessFactor
dcl_temps 1
dcl_indexrange o4.x 2
dcl_indexrange vpc0.x 4
mov r0.x, vJoinInstanceID.x
min r0.y, vpc[r0.x + 0].x, vpc[r0.x + 2].x
mov o[r0.x + 4].x, r0.y
iadd r0.x, -vJoinInstanceID.x, l(1)
min r0.x, vpc[r0.x + 0].x, vpc[r0.x + 2].x
mov r0.y, vJoinInstanceID.x
mov o[r0.y + 4].x, r0.x
ret
// Approximately 14 instruction slots used
// Approximately 15 instruction slots used