Lines Matching refs:context

99 …rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const  in shadeFragments()
107 rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, color); in shadeFragments()
157 …rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const in shadeFragments()
162 const tcu::Vec4 v_coord = rr::readVarying<float>(packets[packetNdx], context, 0, fragNdx); in shadeFragments()
165 …rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, this->m_uniforms[0].sampler.tex2D->sample(… in shadeFragments()
220 …rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const in shadeFragments()
225 const tcu::Vec4 v_coord = rr::readVarying<float>(packets[packetNdx], context, 0, fragNdx); in shadeFragments()
228 …rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, this->m_uniforms[0].sampler.tex2D->sampl… in shadeFragments()
356 …Framebuffer (sglr::Context& context, const FboConfig& config, int width, int height, deUint32 fb…
379 static bool isExtensionSupported (sglr::Context& context, const char* name) in isExtensionSupported() argument
381 std::istringstream extensions(context.getString(GL_EXTENSIONS)); in isExtensionSupported()
393 static void checkColorFormatSupport (sglr::Context& context, deUint32 sizedFormat) in checkColorFormatSupport() argument
401 if (!isExtensionSupported(context, "GL_EXT_color_buffer_half_float")) in checkColorFormatSupport()
409 Framebuffer::Framebuffer (sglr::Context& context, const FboConfig& config, int width, int height, d… in Framebuffer() argument
411 , m_context (context) in Framebuffer()
418 checkColorFormatSupport(context, config.colorbufferFormat); in Framebuffer()
421 context.genFramebuffers(1, &m_framebuffer); in Framebuffer()
422 context.bindFramebuffer(GL_FRAMEBUFFER, m_framebuffer); in Framebuffer()
428 context.genTextures(1, &m_colorbuffer); in Framebuffer()
429 context.bindTexture(GL_TEXTURE_2D, m_colorbuffer); in Framebuffer()
430 context.texImage2D(GL_TEXTURE_2D, 0, m_config.colorbufferFormat, width, height); in Framebuffer()
431 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in Framebuffer()
436 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); in Framebuffer()
437 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); in Framebuffer()
440context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_colorbuffer, 0… in Framebuffer()
449context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_colorbuff… in Framebuffer()
460context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthbuffe… in Framebuffer()
468context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_stencilb… in Framebuffer()
473 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in Framebuffer()
511 static void createMetaballsTex2D (sglr::Context& context, deUint32 name, GLenum format, GLenum data… in createMetaballsTex2D() argument
518 context.bindTexture(GL_TEXTURE_2D, name); in createMetaballsTex2D()
519context.texImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, dataType, level.getAccess()… in createMetaballsTex2D()
520 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in createMetaballsTex2D()
523 static void createQuadsTex2D (sglr::Context& context, deUint32 name, GLenum format, GLenum dataType… in createQuadsTex2D() argument
530 context.bindTexture(GL_TEXTURE_2D, name); in createQuadsTex2D()
531context.texImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, dataType, level.getAccess()… in createQuadsTex2D()
532 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in createQuadsTex2D()
538 …FboRenderCase (Context& context, const char* name, const char* description, const FboConfig& con…
552 FboRenderCase::FboRenderCase (Context& context, const char* name, const char* description, const Fb… in FboRenderCase() argument
553 : TestCase(context, name, description) in FboRenderCase()
585 …sglr::GLContext context(renderCtx, log, sglr::GLCONTEXT_LOG_CALLS, tcu::IVec4(x, y, width, height)… in iterate() local
587 context.clearColor(clearColor.x(), clearColor.y(), clearColor.z(), clearColor.w()); in iterate()
588 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in iterate()
590 render(context, gles2Frame); // Call actual render func in iterate()
591 gles2Error = context.getError(); in iterate()
609 …sglr::ReferenceContext context (sglr::ReferenceContextLimits(renderCtx), buffers.getColorbuffer(… in iterate() local
611 context.clearColor(clearColor.x(), clearColor.y(), clearColor.z(), clearColor.w()); in iterate()
612 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in iterate()
614 render(context, refFrame); in iterate()
615 refError = context.getError(); in iterate()
648 ColorClearsTest (Context& context, const FboConfig& config);
651 void render (sglr::Context& context, Surface& dst);
654 ColorClearsTest::ColorClearsTest (Context& context, const FboConfig& config) in ColorClearsTest() argument
655 : FboRenderCase(context, config.getName().c_str(), "Color buffer clears", config) in ColorClearsTest()
659 void ColorClearsTest::render (sglr::Context& context, Surface& dst) in render() argument
668 Framebuffer fbo(context, getConfig(), width, height); in render()
672 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
673 context.viewport(0, 0, width, height); in render()
674 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
675 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
678 context.enable(GL_SCISSOR_TEST); in render()
689 context.scissor(cX, cY, cWidth, cHeight); in render()
690 context.clearColor(color.x(), color.y(), color.z(), color.w()); in render()
691 context.clear(GL_COLOR_BUFFER_BIT); in render()
695 context.disable(GL_SCISSOR_TEST); in render()
700 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
704 deUint32 shaderID = context.createProgram(&shader); in render()
706 shader.setUnit(context, shaderID, 0); in render()
708 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
709 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
710 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
713 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
718 context.readPixels(dst, 0, 0, width, height); in render()
725 IntersectingQuadsTest (Context& context, const FboConfig& config, bool npot = false);
728 virtual void render (sglr::Context& context, Surface& dst);
740 IntersectingQuadsNpotTest (Context& context, const FboConfig& config) in IntersectingQuadsNpotTest() argument
741 : IntersectingQuadsTest(context, config, true) in IntersectingQuadsNpotTest()
746 IntersectingQuadsTest::IntersectingQuadsTest (Context& context, const FboConfig& config, bool npot) in IntersectingQuadsTest() argument
747 …: FboRenderCase (context, (string(npot ? "npot_" : "") + config.getName()).c_str(), "Intersecting … in IntersectingQuadsTest()
818 MixTest (Context& context, const FboConfig& config, bool npot = false);
821 void render (sglr::Context& context, Surface& dst);
835 MixNpotTest (Context& context, const FboConfig& config) in MixNpotTest() argument
836 : MixTest(context, config, true) in MixNpotTest()
841 MixTest::MixTest (Context& context, const FboConfig& config, bool npot) in MixTest() argument
842 …: FboRenderCase (context, (string(npot ? "mix_npot_" : "mix_") + config.getName()).c_str(), "Use t… in MixTest()
857 void MixTest::render (sglr::Context& context, Surface& dst) in render() argument
862 deUint32 singleTexShaderID = context.createProgram(&singleTexShader); in render()
863 deUint32 mixShaderID = context.createProgram(&mixShader); in render()
867 context.pixelStorei(GL_UNPACK_ALIGNMENT, 1); in render()
868 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
871 singleTexShader.setUnit(context, singleTexShaderID, 0); in render()
872 mixShader.setUnits(context, mixShaderID, 0, 1); in render()
875 Framebuffer fboA(context, getConfig(), m_fboAWidth, m_fboAHeight); in render()
877 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
878 context.viewport(0, 0, m_fboAWidth, m_fboAHeight); in render()
879 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
880 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
881 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
882 sglr::drawQuad(context, singleTexShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
885 Framebuffer fboB(context, getConfig(), m_fboBWidth, m_fboBHeight); in render()
887 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
888 context.viewport(0, 0, m_fboBWidth, m_fboBHeight); in render()
889 context.enable(GL_SCISSOR_TEST); in render()
890 context.scissor(0, 0, 32, 64); in render()
891 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f); in render()
892 context.clear(GL_COLOR_BUFFER_BIT); in render()
893 context.scissor(32, 0, 32, 64); in render()
894 context.clearColor(0.0f, 1.0f, 0.0f, 1.0f); in render()
895 context.clear(GL_COLOR_BUFFER_BIT); in render()
896 context.disable(GL_SCISSOR_TEST); in render()
899 context.activeTexture(GL_TEXTURE0); in render()
900 context.bindTexture(GL_TEXTURE_2D, fboA.getColorbuffer()); in render()
901 context.activeTexture(GL_TEXTURE1); in render()
902 context.bindTexture(GL_TEXTURE_2D, fboB.getColorbuffer()); in render()
903 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
904 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
905 sglr::drawQuad(context, mixShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
907 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
913 BlendTest (Context& context, const FboConfig& config, bool npot = false);
916 void render (sglr::Context& context, Surface& dst);
928 BlendNpotTest (Context& context, const FboConfig& config) in BlendNpotTest() argument
929 : BlendTest(context, config, true) in BlendNpotTest()
934 BlendTest::BlendTest (Context& context, const FboConfig& config, bool npot) in BlendTest() argument
935 …: FboRenderCase (context, (string(npot ? "blend_npot_" : "blend_") + config.getName()).c_str(), "B… in BlendTest()
947 void BlendTest::render (sglr::Context& context, Surface& dst) in render() argument
950 deUint32 shaderID = context.createProgram(&shader); in render()
955 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, 64, 64); in render()
957 Framebuffer fbo(context, getConfig(), width, height); in render()
960 shader.setUnit(context, shaderID, 0); in render()
962 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
963 context.viewport(0, 0, width, height); in render()
964 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
965 context.clearColor(0.6f, 0.0f, 0.6f, 1.0f); in render()
966 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
968 context.enable(GL_BLEND); in render()
969 context.blendEquation(GL_FUNC_ADD); in render()
970 context.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); in render()
971 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
972 context.disable(GL_BLEND); in render()
976 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
977 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
978 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
979 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
980 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
983 context.readPixels(dst, 0, 0, width, height); in render()
989 StencilClearsTest (Context& context, const FboConfig& config);
992 void render (sglr::Context& context, Surface& dst);
997 StencilClearsTest::StencilClearsTest (Context& context, const FboConfig& config) in StencilClearsTest() argument
998 : FboRenderCase(context, config.getName().c_str(), "Stencil clears", config) in StencilClearsTest()
1002 void StencilClearsTest::render (sglr::Context& context, Surface& dst) in render() argument
1005 deUint32 shaderID = context.createProgram(&shader); in render()
1011 createQuadsTex2D(context, quadsTex, GL_RGBA, GL_UNSIGNED_BYTE, width, height); in render()
1012 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, width, height); in render()
1014 Framebuffer fbo(context, getConfig(), width, height); in render()
1018 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1019 context.viewport(0, 0, width, height); in render()
1020 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1021 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1024 context.enable(GL_SCISSOR_TEST); in render()
1025 context.scissor(10, 16, 32, 120); in render()
1026 context.clearStencil(1); in render()
1027 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1028 context.scissor(16, 32, 100, 64); in render()
1029 context.clearStencil(2); in render()
1030 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1031 context.disable(GL_SCISSOR_TEST); in render()
1034 context.activeTexture(GL_TEXTURE0); in render()
1035 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1036 context.activeTexture(GL_TEXTURE1); in render()
1037 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1039 context.enable(GL_STENCIL_TEST); in render()
1040 context.stencilFunc(GL_EQUAL, 1, 0xffffffffu); in render()
1041 shader.setUnit(context, shaderID, 0); in render()
1042 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1044 context.stencilFunc(GL_EQUAL, 2, 0xffffffffu); in render()
1045 shader.setUnit(context, shaderID, 1); in render()
1046 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1048 context.disable(GL_STENCIL_TEST); in render()
1052 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1053 context.activeTexture(GL_TEXTURE0); in render()
1054 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1055 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1056 shader.setUnit(context, shaderID, 0); in render()
1057 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1058 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1061 context.readPixels(dst, 0, 0, width, height); in render()
1072 StencilTest (Context& context, const FboConfig& config, bool npot = false);
1075 void render (sglr::Context& context, Surface& dst);
1087 StencilNpotTest (Context& context, const FboConfig& config) in StencilNpotTest() argument
1088 : StencilTest(context, config, true) in StencilNpotTest()
1093 StencilTest::StencilTest (Context& context, const FboConfig& config, bool npot) in StencilTest() argument
1094 …: FboRenderCase (context, (string(npot ? "npot_" : "") + config.getName()).c_str(), "Stencil ops",… in StencilTest()
1175 SharedColorbufferTest (Context& context, const FboConfig& config);
1178 void render (sglr::Context& context, Surface& dst);
1181 SharedColorbufferTest::SharedColorbufferTest (Context& context, const FboConfig& config) in SharedColorbufferTest() argument
1182 : FboRenderCase(context, config.getName().c_str(), "Shared colorbuffer", config) in SharedColorbufferTest()
1186 void SharedColorbufferTest::render (sglr::Context& context, Surface& dst) in render() argument
1189 deUint32 shaderID = context.createProgram(&shader); in render()
1198 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1199 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, 64, 64); in render()
1201 context.viewport(0, 0, width, height); in render()
1203 shader.setUnit(context, shaderID, 0); in render()
1206 Framebuffer fboA(context, getConfig(), width, height); in render()
1213 Framebuffer fboB(context, cfg, width, height); in render()
1216 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1220context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboA.getColorbuf… in render()
1224context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, fboA.getCol… in render()
1232 context.clear(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1235 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
1236 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1237 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1238 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1243 context.clearStencil(1); in render()
1244 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1247 context.enable(GL_DEPTH_TEST); in render()
1248 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1249 context.disable(GL_DEPTH_TEST); in render()
1252 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1253 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1254 context.enable(GL_BLEND); in render()
1255 context.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); in render()
1256 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1259 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1260 context.enable(GL_DEPTH_TEST); in render()
1261 sglr::drawQuad(context, shaderID, Vec3(0.5f, 0.5f, 0.5f), Vec3(1.0f, 1.0f, 0.5f)); in render()
1262 context.disable(GL_DEPTH_TEST); in render()
1267 deUint32 flatShaderID = context.createProgram(&flatShader); in render()
1269 flatShader.setColor(context, flatShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
1272 context.enable(GL_SCISSOR_TEST); in render()
1273 context.scissor(10, 10, 12, 25); in render()
1274 context.clearStencil(1); in render()
1275 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1276 context.disable(GL_SCISSOR_TEST); in render()
1279 context.enable(GL_STENCIL_TEST); in render()
1280 context.stencilFunc(GL_EQUAL, 1, 0xffu); in render()
1281 sglr::drawQuad(context, flatShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1282 context.disable(GL_STENCIL_TEST); in render()
1288 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1289 context.bindTexture(GL_TEXTURE_2D, fboA.getColorbuffer()); in render()
1290 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1291 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1292 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1295 context.readPixels(dst, 0, 0, width, height); in render()
1301 SharedColorbufferClearsTest (Context& context, const FboConfig& config);
1305 void render (sglr::Context& context, Surface& dst);
1308 SharedColorbufferClearsTest::SharedColorbufferClearsTest (Context& context, const FboConfig& config) in SharedColorbufferClearsTest() argument
1309 : FboRenderCase(context, config.getName().c_str(), "Shared colorbuffer clears", config) in SharedColorbufferClearsTest()
1320 void SharedColorbufferClearsTest::render (sglr::Context& context, Surface& dst) in render() argument
1326 checkColorFormatSupport(context, getConfig().colorbufferFormat); in render()
1331 context.bindTexture(GL_TEXTURE_2D, colorbuffer); in render()
1332 context.texImage2D(GL_TEXTURE_2D, 0, getConfig().colorbufferFormat, width, height); in render()
1333 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1338 context.bindRenderbuffer(GL_RENDERBUFFER, colorbuffer); in render()
1339 context.renderbufferStorage(GL_RENDERBUFFER, getConfig().colorbufferFormat, width, height); in render()
1345 context.bindFramebuffer(GL_FRAMEBUFFER, fbo); in render()
1348context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorbuffer, 0); in render()
1350context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer… in render()
1353 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1357 GLenum status = context.checkFramebufferStatus(GL_FRAMEBUFFER); in render()
1363 context.viewport(0, 0, width, height); in render()
1364 context.clearColor(0.0f, 0.0f, 1.0f, 1.0f); in render()
1365 context.clear(GL_COLOR_BUFFER_BIT); in render()
1367 context.enable(GL_SCISSOR_TEST); in render()
1369 context.bindFramebuffer(GL_FRAMEBUFFER, 2); in render()
1370 context.clearColor(0.6f, 0.0f, 0.0f, 1.0f); in render()
1371 context.scissor(10, 10, 64, 64); in render()
1372 context.clear(GL_COLOR_BUFFER_BIT); in render()
1373 context.clearColor(0.0f, 0.6f, 0.0f, 1.0f); in render()
1374 context.scissor(60, 60, 40, 20); in render()
1375 context.clear(GL_COLOR_BUFFER_BIT); in render()
1377 context.bindFramebuffer(GL_FRAMEBUFFER, 3); in render()
1378 context.clearColor(0.0f, 0.0f, 0.6f, 1.0f); in render()
1379 context.scissor(20, 20, 100, 10); in render()
1380 context.clear(GL_COLOR_BUFFER_BIT); in render()
1382 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1383 context.clearColor(0.6f, 0.0f, 0.6f, 1.0f); in render()
1384 context.scissor(20, 20, 5, 100); in render()
1385 context.clear(GL_COLOR_BUFFER_BIT); in render()
1387 context.disable(GL_SCISSOR_TEST); in render()
1392 deUint32 shaderID = context.createProgram(&shader); in render()
1394 shader.setUnit(context, shaderID, 0); in render()
1396 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1397 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1398 sglr::drawQuad(context, shaderID, Vec3(-0.9f, -0.9f, 0.0f), Vec3(0.9f, 0.9f, 0.0f)); in render()
1399 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1402 context.readPixels(dst, 0, 0, width, height); in render()
1408 SharedDepthbufferTest (Context& context, const FboConfig& config);
1412 void render (sglr::Context& context, Surface& dst);
1415 SharedDepthbufferTest::SharedDepthbufferTest (Context& context, const FboConfig& config) in SharedDepthbufferTest() argument
1416 : FboRenderCase(context, config.getName().c_str(), "Shared depthbuffer", config) in SharedDepthbufferTest()
1425 void SharedDepthbufferTest::render (sglr::Context& context, Surface& dst) in render() argument
1429 deUint32 texShaderID = context.createProgram(&texShader); in render()
1430 deUint32 colorShaderID = context.createProgram(&colorShader); in render()
1436 texShader.setUnit(context, texShaderID, 0); in render()
1437 colorShader.setColor(context, colorShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
1442 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1443 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1445 context.viewport(0, 0, width, height); in render()
1448 Framebuffer fboA(context, getConfig(), width, height); in render()
1455 Framebuffer fboB(context, cfg, width, height); in render()
1459 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1460context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fboA.getDept… in render()
1463 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f); in render()
1464 context.clearStencil(1); in render()
1465 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1468 context.enable(GL_DEPTH_TEST); in render()
1471 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
1472 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1473 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1474 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1475 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1478 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1479 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1480 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, -1.0f), Vec3(1.0f, 1.0f, 1.0f)); in render()
1482 context.disable(GL_DEPTH_TEST); in render()
1487 context.enable(GL_SCISSOR_TEST); in render()
1488 context.scissor(10, 10, 12, 25); in render()
1489 context.clearStencil(0); in render()
1490 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1491 context.disable(GL_SCISSOR_TEST); in render()
1494 context.enable(GL_STENCIL_TEST); in render()
1495 context.stencilFunc(GL_EQUAL, 0, 0xffu); in render()
1496 sglr::drawQuad(context, colorShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1497 context.disable(GL_STENCIL_TEST); in render()
1503 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1504 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1505 context.bindTexture(GL_TEXTURE_2D, fboA.getColorbuffer()); in render()
1506 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); in render()
1507 context.bindTexture(GL_TEXTURE_2D, fboB.getColorbuffer()); in render()
1508 sglr::drawQuad(context, texShaderID, Vec3(0.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1510 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1515 context.readPixels(dst, 0, 0, width, height); in render()
1522 TexSubImageAfterRenderTest (Context& context, const FboConfig& config);
1526 void render (sglr::Context& context, Surface& dst);
1529 TexSubImageAfterRenderTest::TexSubImageAfterRenderTest (Context& context, const FboConfig& config) in TexSubImageAfterRenderTest() argument
1530 …: FboRenderCase(context, (string("after_render_") + config.getName()).c_str(), "TexSubImage after … in TexSubImageAfterRenderTest()
1542 void TexSubImageAfterRenderTest::render (sglr::Context& context, Surface& dst) in render() argument
1545 deUint32 shaderID = context.createProgram(&shader); in render()
1554 shader.setUnit(context, shaderID, 0); in render()
1557 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1558 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1559context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, fourQuads.getAcc… in render()
1561 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1564 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1565 context.texImage2D(GL_TEXTURE_2D, 0, isRGBA ? GL_RGBA : GL_RGB, 128, 128); in render()
1566 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1567 context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0); in render()
1570 context.viewport(0, 0, 128, 128); in render()
1571 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1572 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1575 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1576context.texSubImage2D(GL_TEXTURE_2D, 0, 32, 32, 64, 64, isRGBA ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYT… in render()
1579 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1580 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1581 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1582 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1588 TexSubImageBetweenRenderTest (Context& context, const FboConfig& config);
1592 void render (sglr::Context& context, Surface& dst);
1595 TexSubImageBetweenRenderTest::TexSubImageBetweenRenderTest (Context& context, const FboConfig& conf… in TexSubImageBetweenRenderTest() argument
1596 …: FboRenderCase(context, (string("between_render_") + config.getName()).c_str(), "TexSubImage betw… in TexSubImageBetweenRenderTest()
1608 void TexSubImageBetweenRenderTest::render (sglr::Context& context, Surface& dst) in render() argument
1611 deUint32 shaderID = context.createProgram(&shader); in render()
1624 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1625 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1626context.texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, metaballs2.get… in render()
1629 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1630 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1631context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, fourQuads.getAcc… in render()
1633 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1636 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1637 context.texImage2D(GL_TEXTURE_2D, 0, isRGBA ? GL_RGBA : GL_RGB, 128, 128); in render()
1638 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1639 context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0); in render()
1641 shader.setUnit(context, shaderID, 0); in render()
1644 context.viewport(0, 0, 128, 128); in render()
1645 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1646 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1649 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1650context.texSubImage2D(GL_TEXTURE_2D, 0, 32, 32, 64, 64, isRGBA ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYT… in render()
1653 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1654 context.enable(GL_BLEND); in render()
1655 context.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); in render()
1656 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1657 context.disable(GL_BLEND); in render()
1660 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1661 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1662 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1663 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1665 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1671 ResizeTest (Context& context, const FboConfig& config);
1674 void render (sglr::Context& context, Surface& dst);
1677 ResizeTest::ResizeTest (Context& context, const FboConfig& config) in ResizeTest() argument
1678 : FboRenderCase(context, config.getName().c_str(), "Resize framebuffer", config) in ResizeTest()
1682 void ResizeTest::render (sglr::Context& context, Surface& dst) in render() argument
1686 deUint32 texShaderID = context.createProgram(&texShader); in render()
1687 deUint32 colorShaderID = context.createProgram(&colorShader); in render()
1693 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1694 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 32, 32); in render()
1696 Framebuffer fbo(context, getConfig(), 128, 128); in render()
1700 texShader.setUnit(context, texShaderID, 0); in render()
1701 colorShader.setColor(context, colorShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
1704 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1705 context.viewport(0, 0, 128, 128); in render()
1706 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1707 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1708 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1709 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1714 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1715 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1716 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1717 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1720 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1730 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1731 context.texImage2D(GL_TEXTURE_2D, 0, fbo.getConfig().colorbufferFormat, newWidth, newHeight); in render()
1735 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getColorbuffer()); in render()
1736context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().colorbufferFormat, newWidth, newHeigh… in render()
1746 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getDepthbuffer()); in render()
1747context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().depthbufferFormat, newWidth, newHeigh… in render()
1753 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getStencilbuffer()); in render()
1754context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().stencilbufferFormat, newWidth, newHei… in render()
1758 context.viewport(0, 0, newWidth, newHeight); in render()
1759 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f); in render()
1760 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1762 context.enable(GL_DEPTH_TEST); in render()
1764 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1765 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
1767 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1768 sglr::drawQuad(context, texShaderID, Vec3(0.0f, 0.0f, -1.0f), Vec3(+1.0f, +1.0f, 1.0f)); in render()
1770 context.disable(GL_DEPTH_TEST); in render()
1774 context.enable(GL_SCISSOR_TEST); in render()
1775 context.scissor(10, 10, 5, 15); in render()
1776 context.clearStencil(1); in render()
1777 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1778 context.disable(GL_SCISSOR_TEST); in render()
1780 context.enable(GL_STENCIL_TEST); in render()
1781 context.stencilFunc(GL_EQUAL, 1, 0xffu); in render()
1782 sglr::drawQuad(context, colorShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
1783 context.disable(GL_STENCIL_TEST); in render()
1788 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1789 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1790 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1791 sglr::drawQuad(context, texShaderID, Vec3(-0.5f, -0.5f, 0.0f), Vec3(0.5f, 0.5f, 0.0f)); in render()
1792 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1795 context.readPixels(dst, 0, 0, newWidth, newHeight); in render()
1802 RecreateBuffersTest (Context& context, const FboConfig& config, bool rebind);
1806 void render (sglr::Context& context, Surface& dst);
1816 RecreateBuffersNoRebindTest (Context& context, const FboConfig& config) in RecreateBuffersNoRebindTest() argument
1817 : RecreateBuffersTest<Buffers>(context, config, false) in RecreateBuffersNoRebindTest()
1826 RecreateBuffersRebindTest (Context& context, const FboConfig& config) in RecreateBuffersRebindTest() argument
1827 : RecreateBuffersTest<Buffers>(context, config, true) in RecreateBuffersRebindTest()
1833 RecreateBuffersTest<Buffers>::RecreateBuffersTest (Context& context, const FboConfig& config, bool … in RecreateBuffersTest() argument
1834 …: FboRenderCase (context, (string(rebind ? "rebind_" : "no_rebind_") + config.getName()).c_str(),… in RecreateBuffersTest()
1988 RepeatedClearCase (Context& context, deUint32 format) in RepeatedClearCase() argument
1989 …: FboRenderCase(context, makeConfig(format).getName().c_str(), "Repeated clears", makeConfig(forma… in RepeatedClearCase()
2060 FboRenderTestGroup::FboRenderTestGroup (Context& context) in FboRenderTestGroup() argument
2061 : TestCaseGroup(context, "render", "Rendering Tests") in FboRenderTestGroup()