[D3D12] Fake per-edge tessellation with continuous

This commit is contained in:
Triang3l
2018-12-12 22:08:20 +03:00
parent 19d7e0ce3d
commit 2b646ff425
38 changed files with 3382 additions and 598 deletions

View File

@@ -0,0 +1,35 @@
#include "xenos_draw.hlsli"
struct XeHSControlPointOutput {};
struct XeHSConstantDataOutput {
float edges[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
XeHSConstantDataOutput XePatchConstant() {
XeHSConstantDataOutput output = (XeHSConstantDataOutput)0;
uint i;
// 1.0 is already added to the factor on the CPU, according to the images in
// https://www.slideshare.net/blackdevilvikas/next-generation-graphics-programming-on-xbox-360
// (fractional_even also requires a factor of at least 2.0).
// Don't calculate any variables for SV_TessFactor outside of this loop, or
// everything will be broken - FXC will add code to make it calculated only
// once for all 3 fork instances, but doesn't do it properly.
[unroll] for (i = 0; i < 3; ++i) {
output.edges[i] = xe_tessellation_factor_range.y;
}
output.inside = xe_tessellation_factor_range.y;
return output;
}
[domain("tri")]
[partitioning("fractional_even")]
[outputtopology("triangle_cw")]
[outputcontrolpoints(3)]
[patchconstantfunc("XePatchConstant")]
void main(InputPatch<XeHSControlPointOutput, 3> input_patch) {}