@@ -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+
34863546class GLSLValidationClipDistanceTest_ES3 : public GLSLValidationTest_ES3
34873547{};
34883548
0 commit comments