Closed n3b closed 3 months ago
tessellation shaders are supported
it seems that we did not implement:
SV_InsideTessFactor
->TessLevelInner
for SPIRVSV_InsideTessFactor
->gl_TessLevelOuter
for GLSL@ArielG-NV Sorry I didn't notice that you already assigned this issue yourself, but I have just fixed this along with the other spirv issue.
Hey, thanks for a quick turnaround!
Unfortunately I still see issues even with the https://github.com/shader-slang/slang/pull/4318, but I might be missing something
hlsl.meta.slang(3698): error 29000: unable to parse target intrinsic snippet: .operator[]
hlsl.meta.slang(3698): error 29000: unable to parse target intrinsic snippet: .operator[]
hlsl.meta.slang(3698): error 29000: unable to parse target intrinsic snippet: .operator[]
hlsl.meta.slang(3698): error 29000: unable to parse target intrinsic snippet: .operator[]
hlsl.meta.slang(3698): error 29000: unable to parse target intrinsic snippet: .operator[]
hlsl.meta.slang(3698): error 29000: unable to parse target intrinsic snippet: .operator[]
hlsl.meta.slang(3698): error 29000: unable to parse target intrinsic snippet: .operator[]
(0): error 99999: Slang compilation aborted due to an exception of class Slang::InternalError: unimplemented: Unhandled global inst in spirv-emit:
let %1 : _ = InputPatch(%VSx5FOUT, %2)
struct VS_OUT
{
float3 position : POSITION;
};
struct HS_OUT
{
float3 position : POSITION;
};
struct HSC_OUT
{
float EdgeTessFactor[4] : SV_TessFactor;
float InsideTessFactor[2] : SV_InsideTessFactor;
};
// Hull Shader (HS)
[domain("quad")]
[partitioning("integer")]
[outputtopology("triangle_cw")]
[outputcontrolpoints(4)]
[patchconstantfunc("constants")]
HS_OUT main(InputPatch<VS_OUT, 4> patch, uint i : SV_OutputControlPointID)
{
HS_OUT o;
o.position = patch[i].position;
return o;
}
HSC_OUT constants(InputPatch<VS_OUT, 4> patch)
{
float3 p0 = patch[0].position;
float3 p1 = patch[1].position;
float3 p2 = patch[2].position;
float3 p3 = patch[3].position;
HSC_OUT o;
o.EdgeTessFactor[0] = dot(p0, p1);
o.EdgeTessFactor[1] = dot(p0, p3);
o.EdgeTessFactor[2] = dot(p2, p3);
o.EdgeTessFactor[3] = dot(p1, p2);
o.InsideTessFactor[0] = lerp(o.EdgeTessFactor[1], o.EdgeTessFactor[3], 0.5);
o.InsideTessFactor[1] = lerp(o.EdgeTessFactor[0], o.EdgeTessFactor[2], 0.5);
return o;
}
Respectively domain shader complains that OutputPatch
is not implemented
I think you are right. We haven't fully supported tessellation stages for SPIRV yet, but I think we are close and I'll make sure these are supported today.
Opened https://github.com/shader-slang/slang/issues/4332 to track development of InputPatch and OutputPatch.
Are tessellation shaders supported yet? Is there an example how to map both endpoints to the hull stage?
Also, VulkanUtil::getShaderStage: domain stage is mapped to VK control, hull to evaluation https://github.com/shader-slang/slang/blob/master/tools/gfx/vulkan/vk-util.cpp#L183
A simple sample I get the error with (v2024.1.21, SPIRV target):