Closed csyonghe closed 3 weeks ago
Closes #4332.
The main task here is to properly lower InputPatch<T> and OutputPatch<T> to array types in SPIRV, and to combine both the hull shader and the patch constant function into a single entrypoint for SPIRV.
InputPatch<T>
OutputPatch<T>
A hull shader in the form of:
struct HullInput { float3 inElement; } struct ConstantOutput { float factor[4] : SV_TessFactor; } struct HullOutput { float3 outElement; } ConstantOutput constantFunc(InputPatch<HullInput, N> inPatch, OutputPatch<HullOutput, N> outPatch) { // compute tess factor } [patchconstantfunc("constantFunc")] HullOutput hull(InputPatch<HullInput, N> patch, int i : SV_OutputControlPointID) { // compute outElmeent }
should be transformed to:
in float3 inElement[N]; out float3 outElement[N]; void hull() { // compute outElement (original hull shader body) barrier; if (gl_InvocationID == 0) { // compute tess factor and set gl_TessLevelInner[N]; (constantFunc) } }
Thank you for your kind words and for the prompt review, Jay!
Closes #4332.
The main task here is to properly lower
InputPatch<T>
andOutputPatch<T>
to array types in SPIRV, and to combine both the hull shader and the patch constant function into a single entrypoint for SPIRV.A hull shader in the form of:
should be transformed to: