Add missing extension requirement
authorJari Komppa <jari.komppa@siru.fi>
Thu, 4 Nov 2021 11:40:07 +0000 (13:40 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 2 Dec 2021 20:59:53 +0000 (20:59 +0000)
This change adds the missing #extension line in the shader for the
fragdata.draw_buffers test if extension is supported.

Affects:
dEQP-GLES3.functional.shaders.fragdata.draw_buffers

Components: OpenGL
VK-GL-CTS issue: 3259

Change-Id: Id644e83b938fd3f2e22769faf727043bee88f62d

modules/gles3/functional/es3fShaderFragDataTests.cpp

index dd0e578..8079ca9 100644 (file)
@@ -251,6 +251,13 @@ public:
                if(!isExtensionSupported(renderCtx, "GL_EXT_draw_buffers") && !isExtensionSupported(renderCtx, "GL_NV_draw_buffers"))
                        num_test_attachment = 1;
 
+               std::string extensionString;
+               if (isExtensionSupported(renderCtx, "GL_EXT_draw_buffers"))
+                       extensionString = "#extension GL_EXT_draw_buffers : require\n";
+               else
+                       if (isExtensionSupported(renderCtx, "GL_NV_draw_buffers"))
+                               extensionString = "#extension GL_NV_draw_buffers : require\n";
+
                const glu::ShaderProgram                program                 (renderCtx, glu::ProgramSources()
                                                                                                                        << glu::VertexSource(
                                                                                                                                "attribute highp vec4 a_position;\n"
@@ -262,6 +269,7 @@ public:
                                                                                                                                "       v_color = a_color;\n"
                                                                                                                                "}\n")
                                                                                                                        << glu::FragmentSource(
+                                                                                                                               extensionString +
                                                                                                                                "varying mediump vec4 v_color;\n"
                                                                                                                                "uniform mediump int u_index;\n"
                                                                                                                                "void main (void)\n"