Unverified Commit e00d27c6 by greg-lunarg Committed by GitHub

Fix missing patch decoration for TessFactor PCF arg (#2249)

Fixes #1553
parent 41f62a81
// Test tesselation factor output as PCF arg
struct VSOutput
{
float4 f4Position : SV_Position;
float3 f3Color : COLOR;
};
struct HS_CONSTANT_DATA_OUTPUT
{
float Edges[4] : SV_TessFactor;
};
HS_CONSTANT_DATA_OUTPUT ConstantHS(InputPatch<VSOutput, 1> p,
uint BlockID : SV_PrimitiveID,
out float Inside[2] : SV_InsideTessFactor)
{
HS_CONSTANT_DATA_OUTPUT Factors;
Factors.Edges[0] = 2.5;
Factors.Edges[1] = 4.25;
Factors.Edges[2] = 5.75;
Factors.Edges[3] = 7.5;
Inside[0] = 6.75;
Inside[1] = 7.25;
return Factors;
}
struct HSOutput
{
float4 Position : POS;
float3 Color : COL;
};
[domain("quad")]
[partitioning("fractional_even")]
[outputtopology("triangle_ccw")]
[outputcontrolpoints(1)]
[patchconstantfunc("ConstantHS")]
HSOutput main(InputPatch<VSOutput, 1> inputPatch, uint uCPID : SV_OutputControlPointID)
{
HSOutput Out;
Out.Position = inputPatch[uCPID].f4Position;
Out.Color = inputPatch[uCPID].f3Color;
return Out;
}
...@@ -227,6 +227,7 @@ INSTANTIATE_TEST_CASE_P( ...@@ -227,6 +227,7 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.hull.3.tesc", "main"}, {"hlsl.hull.3.tesc", "main"},
{"hlsl.hull.4.tesc", "main"}, {"hlsl.hull.4.tesc", "main"},
{"hlsl.hull.5.tesc", "main"}, {"hlsl.hull.5.tesc", "main"},
{"hlsl.hull.6.tesc", "main"},
{"hlsl.hull.void.tesc", "main"}, {"hlsl.hull.void.tesc", "main"},
{"hlsl.hull.ctrlpt-1.tesc", "main"}, {"hlsl.hull.ctrlpt-1.tesc", "main"},
{"hlsl.hull.ctrlpt-2.tesc", "main"}, {"hlsl.hull.ctrlpt-2.tesc", "main"},
......
...@@ -9791,6 +9791,8 @@ void HlslParseContext::addPatchConstantInvocation() ...@@ -9791,6 +9791,8 @@ void HlslParseContext::addPatchConstantInvocation()
} else { } else {
// Use the original declaration type for the linkage // Use the original declaration type for the linkage
paramType->getQualifier().builtIn = biType; paramType->getQualifier().builtIn = biType;
if (biType == EbvTessLevelInner || biType == EbvTessLevelInner)
paramType->getQualifier().patch = true;
if (notInEntryPoint.count(tInterstageIoData(biType, storage)) == 1) if (notInEntryPoint.count(tInterstageIoData(biType, storage)) == 1)
addToLinkage(*paramType, patchConstantFunction[p].name, nullptr); addToLinkage(*paramType, patchConstantFunction[p].name, nullptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment