Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIRV] Error when compiling Tess Factor args to PCF #2926

Open
greg-lunarg opened this issue May 28, 2020 · 2 comments
Open

[SPIRV] Error when compiling Tess Factor args to PCF #2926

greg-lunarg opened this issue May 28, 2020 · 2 comments
Assignees
Labels

Comments

@greg-lunarg
Copy link

@greg-lunarg greg-lunarg commented May 28, 2020

Compiling the shader below with the options:

dxc.exe -spirv -E main -T hs_6_0 -fspv-target-env=vulkan1.1 bad.tesc -Fo bad.tesc.dxc.spv

Gives the error:

bad.tesc:14:46: error: patch constant function parameter 'Inside' unknown
                                   out float Inside[2] : SV_InsideTessFactor)
                                             ^

Compiling to DXIL occurs without error:

dxc.exe -E main -T hs_6_0 bad.tesc -Fo bad.tesc.dxil

bad.tesc:

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;
}

Related: KhronosGroup/glslang#1553

@greg-lunarg
Copy link
Author

@greg-lunarg greg-lunarg commented May 28, 2020

I tried dxc when addressing the glslang issue above and saw this error and thought you might like to know.

@ehsannas ehsannas added the spirv label May 28, 2020
@ehsannas ehsannas self-assigned this May 28, 2020
@ehsannas
Copy link
Collaborator

@ehsannas ehsannas commented May 28, 2020

Thanks for reporting @greg-lunarg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.