Skip to content

Commit ec0784d

Browse files
ShabbyXAngle LUCI CQ
authored andcommitted
Port EXT_shader_framebuffer_fetch validation tests to end2nd
Bug: angleproject:454531087 Change-Id: I1d812ec5cdb1c819c3a9ddecf6b9fd42283cc48d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7148162 Commit-Queue: Shahbaz Youssefi <[email protected]> Reviewed-by: Yuxin Hu <[email protected]>
1 parent 54dcc63 commit ec0784d

File tree

3 files changed

+60
-322
lines changed

3 files changed

+60
-322
lines changed

src/tests/angle_unittests.gni

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ angle_unittests_compiler_tests_sources = [
9393
"compiler_tests/CollectVariables_test.cpp",
9494
"compiler_tests/ConstructCompiler_test.cpp",
9595
"compiler_tests/EXT_clip_cull_distance_test.cpp",
96-
"compiler_tests/EXT_shader_framebuffer_fetch_test.cpp",
9796
"compiler_tests/ExpressionLimit_test.cpp",
9897
"compiler_tests/FloatLex_test.cpp",
9998
"compiler_tests/FragDepth_test.cpp",

src/tests/compiler_tests/EXT_shader_framebuffer_fetch_test.cpp

Lines changed: 0 additions & 321 deletions
This file was deleted.

src/tests/gl_tests/GLSLValidationTest.cpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3483,6 +3483,66 @@ void main()
34833483
validateSuccess(GL_FRAGMENT_SHADER, kFS);
34843484
}
34853485

3486+
// Use gl_LastFragData without redeclaration of gl_LastFragData with noncoherent qualifier
3487+
TEST_P(GLSLValidationTest, FramebufferFetchNoLastFragDataRedeclaration)
3488+
{
3489+
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch_non_coherent"));
3490+
3491+
const char kFS[] =
3492+
R"(#extension GL_EXT_shader_framebuffer_fetch_non_coherent : require
3493+
uniform highp vec4 u_color;
3494+
3495+
void main (void)
3496+
{
3497+
gl_FragColor = u_color + gl_LastFragData[0];
3498+
})";
3499+
3500+
validateError(GL_FRAGMENT_SHADER, kFS,
3501+
"'noncoherent' qualifier must be used when "
3502+
"GL_EXT_shader_framebuffer_fetch_non_coherent extension is used");
3503+
}
3504+
3505+
// Redeclare gl_LastFragData without noncoherent qualifier
3506+
TEST_P(GLSLValidationTest, FramebufferFetchLastFragDataWithoutNoncoherentQualifier)
3507+
{
3508+
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch_non_coherent"));
3509+
3510+
const char kFS[] =
3511+
R"(#extension GL_EXT_shader_framebuffer_fetch_non_coherent : require
3512+
uniform highp vec4 u_color;
3513+
highp vec4 gl_LastFragData[gl_MaxDrawBuffers];
3514+
3515+
void main (void)
3516+
{
3517+
gl_FragColor = u_color + gl_LastFragData[0];
3518+
})";
3519+
3520+
validateError(GL_FRAGMENT_SHADER, kFS,
3521+
"'noncoherent' qualifier must be used when "
3522+
"GL_EXT_shader_framebuffer_fetch_non_coherent extension is used");
3523+
}
3524+
3525+
// Declare inout without noncoherent qualifier
3526+
TEST_P(GLSLValidationTest_ES3, FramebufferFetchInoutWithoutNoncoherentQualifier)
3527+
{
3528+
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch_non_coherent"));
3529+
3530+
const char kFS[] =
3531+
R"(#version 300 es
3532+
#extension GL_EXT_shader_framebuffer_fetch_non_coherent : require
3533+
layout(location = 0) inout highp vec4 o_color;
3534+
uniform highp vec4 u_color;
3535+
3536+
void main (void)
3537+
{
3538+
o_color = clamp(o_color + u_color, vec4(0.0f), vec4(1.0f));
3539+
})";
3540+
3541+
validateError(GL_FRAGMENT_SHADER, kFS,
3542+
"'noncoherent' qualifier must be used when "
3543+
"GL_EXT_shader_framebuffer_fetch_non_coherent extension is used");
3544+
}
3545+
34863546
class GLSLValidationClipDistanceTest_ES3 : public GLSLValidationTest_ES3
34873547
{};
34883548

0 commit comments

Comments
 (0)