Skip to content

Commit

Permalink
Fail link and validation of invalid tessellation program
Browse files Browse the repository at this point in the history
The GL_EXT_tessellation_shader spec says -
    The tessellation control and evaluation shaders are both optional.
    If neither shader type is present, the tessellation stage has no
    effect. However, if either a tessellation control or a tessellation
    evaluation shader is present, the other must also be present.

Fail link and validation if a program contains TCS or TES shader but not
both.

Bug: angleproject:3572
Tests: KHR-GLES32.core.tessellation_shader.single.xfb_captures_data_from_correct_stage
Change-Id: I6799f101a186f3bfae738df442e9aeee691fd91a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5410646
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: mohan maiya <[email protected]>
  • Loading branch information
Mohan Maiya authored and Angle LUCI CQ committed Apr 2, 2024
1 parent 47ca755 commit 85b3e96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/libANGLE/ProgramPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,12 @@ angle::Result ProgramPipeline::link(const Context *context)
const Version &clientVersion = context->getClientVersion();
const bool isWebGL = context->isWebGL();

if (mState.mExecutable->hasLinkedShaderStage(gl::ShaderType::TessControl) !=
mState.mExecutable->hasLinkedShaderStage(gl::ShaderType::TessEvaluation))
{
return angle::Result::Stop;
}

if (mState.mExecutable->hasLinkedShaderStage(ShaderType::Vertex))
{
if (!linkVaryings())
Expand Down Expand Up @@ -706,6 +712,15 @@ void ProgramPipeline::validate(const Context *context)
mState.mValid = true;
mState.mInfoLog.reset();

if (mState.mExecutable->hasLinkedShaderStage(gl::ShaderType::TessControl) !=
mState.mExecutable->hasLinkedShaderStage(gl::ShaderType::TessEvaluation))
{
mState.mValid = false;
mState.mInfoLog << "Program pipeline must have both a Tessellation Control and Evaluation "
"shader or neither\n";
return;
}

for (const ShaderType shaderType : mState.mExecutable->getLinkedShaderStages())
{
Program *shaderProgram = mState.mPrograms[shaderType];
Expand Down
3 changes: 0 additions & 3 deletions src/tests/deqp_support/deqp_khr_gles32_test_expectations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
// Failures on older nvidia drivers
5557 VULKAN WIN NVIDIA : KHR-GLES32.core.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_PatchVerticesIn = FAIL
5557 VULKAN WIN NVIDIA : KHR-GLES32.core.tessellation_shader.tessellation_shader_tessellation.gl_InvocationID_PatchVerticesIn_PrimitiveID = FAIL
// Expects separable program to fail but doesn't
5557 VULKAN WIN : KHR-GLES32.core.tessellation_shader.single.xfb_captures_data_from_correct_stage = SKIP

// Slow test
5557 VULKAN WIN : KHR-GLES32.core.tessellation_shader.vertex.vertex_ordering = SKIP
Expand Down Expand Up @@ -114,7 +112,6 @@

// Samsung Galaxy S22 (Xclipse)
b/267953710 GALAXYS22 VULKAN : KHR-GLES32.core.tessellation_shader.tessellation_shader_tessellation.gl_InvocationID_PatchVerticesIn_PrimitiveID = SKIP
b/267953710 GALAXYS22 VULKAN : KHR-GLES32.core.tessellation_shader.single.xfb_captures_data_from_correct_stage = SKIP

// Samsung Galaxy S23
8157 GALAXYS23 VULKAN : KHR-GLES32.shaders.function.global_variable_aliasing_fragment = SKIP
Expand Down

0 comments on commit 85b3e96

Please sign in to comment.