Lines Matching refs:context
140 …Framebuffer (sglr::Context& context, const FboConfig& config, int width, int height, deUint32 f…
191 static bool isExtensionSupported (sglr::Context& context, const char* name) in isExtensionSupported() argument
193 std::istringstream extensions(context.getString(GL_EXTENSIONS)); in isExtensionSupported()
205 static bool isAnyExtensionSupported (sglr::Context& context, const std::vector<std::string>& requir… in isAnyExtensionSupported() argument
214 if (isExtensionSupported(context, extension.c_str())) in isAnyExtensionSupported()
236 static void checkColorFormatSupport (sglr::Context& context, deUint32 sizedFormat) in checkColorFormatSupport() argument
240 if (!isAnyExtensionSupported(context, requiredExts)) in checkColorFormatSupport()
249 Framebuffer::Framebuffer (sglr::Context& context, const FboConfig& config, int width, int height, d… in Framebuffer() argument
251 , m_context (context) in Framebuffer()
257 checkColorFormatSupport(context, config.colorFormat); in Framebuffer()
260 context.genFramebuffers(1, &m_framebuffer); in Framebuffer()
261 context.bindFramebuffer(GL_FRAMEBUFFER, m_framebuffer); in Framebuffer()
269 …context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_colorBuffer, 0… in Framebuffer()
274 …context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_colorBuff… in Framebuffer()
303 …case GL_TEXTURE_2D: context.framebufferTexture2D(GL_FRAMEBUFFER, point, GL_TEXTURE_2D, m_depthSte… in Framebuffer()
304 …case GL_RENDERBUFFER: context.framebufferRenderbuffer(GL_FRAMEBUFFER, point, GL_RENDERBUFFER, m_de… in Framebuffer()
314 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in Framebuffer()
375 static void createMetaballsTex2D (sglr::Context& context, deUint32 name, GLenum format, GLenum data… in createMetaballsTex2D() argument
382 context.bindTexture(GL_TEXTURE_2D, name); in createMetaballsTex2D()
383 …context.texImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, dataType, level.getAccess()… in createMetaballsTex2D()
384 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in createMetaballsTex2D()
387 static void createQuadsTex2D (sglr::Context& context, deUint32 name, GLenum format, GLenum dataType… in createQuadsTex2D() argument
394 context.bindTexture(GL_TEXTURE_2D, name); in createQuadsTex2D()
395 …context.texImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, dataType, level.getAccess()… in createQuadsTex2D()
396 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in createQuadsTex2D()
402 …FboRenderCase (Context& context, const char* name, const char* description, const FboConfig& con…
414 FboRenderCase::FboRenderCase (Context& context, const char* name, const char* description, const Fb… in FboRenderCase() argument
415 : TestCase (context, name, description) in FboRenderCase()
447 …sglr::GLContext context(renderCtx, log, sglr::GLCONTEXT_LOG_CALLS, tcu::IVec4(x, y, width, height)… in iterate() local
449 context.clearColor(clearColor.x(), clearColor.y(), clearColor.z(), clearColor.w()); in iterate()
450 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in iterate()
452 render(context, gles3Frame); // Call actual render func in iterate()
453 gles3Error = context.getError(); in iterate()
471 …sglr::ReferenceContext context (sglr::ReferenceContextLimits(renderCtx), buffers.getColorbuffer(… in iterate() local
473 context.clearColor(clearColor.x(), clearColor.y(), clearColor.z(), clearColor.w()); in iterate()
474 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in iterate()
476 render(context, refFrame); in iterate()
477 refError = context.getError(); in iterate()
516 StencilClearsTest (Context& context, const FboConfig& config);
519 void render (sglr::Context& context, Surface& dst);
522 StencilClearsTest::StencilClearsTest (Context& context, const FboConfig& config) in StencilClearsTest() argument
523 : FboRenderCase (context, config.getName().c_str(), "Stencil clears", config) in StencilClearsTest()
527 void StencilClearsTest::render (sglr::Context& context, Surface& dst) in render() argument
539 deUint32 texToFboShaderID = context.createProgram(&texToFboShader); in render()
540 deUint32 texFromFboShaderID = context.createProgram(&texFromFboShader); in render()
550 createQuadsTex2D(context, quadsTex, GL_RGBA, GL_UNSIGNED_BYTE, width, height); in render()
551 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, width, height); in render()
553 Framebuffer fbo(context, m_config, width, height); in render()
557 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
558 context.viewport(0, 0, width, height); in render()
559 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
560 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
563 context.enable(GL_SCISSOR_TEST); in render()
564 context.scissor(10, 16, 32, 120); in render()
565 context.clearStencil(1); in render()
566 context.clear(GL_STENCIL_BUFFER_BIT); in render()
567 context.scissor(16, 32, 100, 64); in render()
568 context.clearStencil(2); in render()
569 context.clear(GL_STENCIL_BUFFER_BIT); in render()
570 context.disable(GL_SCISSOR_TEST); in render()
573 context.enable(GL_STENCIL_TEST); in render()
575 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
576 context.stencilFunc(GL_EQUAL, 1, 0xffu); in render()
578 texToFboShader.setUniforms(context, texToFboShaderID); in render()
579 sglr::drawQuad(context, texToFboShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
581 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
582 context.stencilFunc(GL_EQUAL, 2, 0xffu); in render()
584 texToFboShader.setUniforms(context, texToFboShaderID); in render()
585 sglr::drawQuad(context, texToFboShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
587 context.disable(GL_STENCIL_TEST); in render()
591 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
592 context.bindTexture(GL_TEXTURE_2D, fbo.getColorBuffer()); in render()
593 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
595 texFromFboShader.setUniforms(context, texFromFboShaderID); in render()
596 sglr::drawQuad(context, texFromFboShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
598 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
601 …readPixels(context, dst, 0, 0, width, height, colorFormat, fboRangeInfo.lookupScale, fboRangeInfo.… in render()
607 SharedColorbufferTest (Context& context, const FboConfig& config);
610 void render (sglr::Context& context, Surface& dst);
613 SharedColorbufferTest::SharedColorbufferTest (Context& context, const FboConfig& config) in SharedColorbufferTest() argument
614 : FboRenderCase (context, config.getName().c_str(), "Shared colorbuffer", config) in SharedColorbufferTest()
618 void SharedColorbufferTest::render (sglr::Context& context, Surface& dst) in render() argument
622 deUint32 texShaderID = context.createProgram(&texShader); in render()
623 deUint32 flatShaderID = context.createProgram(&flatShader); in render()
631 context.disable(GL_DITHER); in render()
634 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
635 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, 64, 64); in render()
637 context.viewport(0, 0, width, height); in render()
640 Framebuffer fboA(context, m_config, width, height); in render()
648 Framebuffer fboB(context, cfg, width, height); in render()
651 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
655 …context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboA.getColorBuf… in render()
659 …context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, fboA.getCol… in render()
667 context.clear(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
670 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
671 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
672 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
673 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
678 context.clearStencil(1); in render()
679 context.clear(GL_STENCIL_BUFFER_BIT); in render()
682 texShader.setUniforms(context, texShaderID); in render()
684 context.enable(GL_DEPTH_TEST); in render()
685 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
686 context.disable(GL_DEPTH_TEST); in render()
689 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
690 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
691 context.enable(GL_BLEND); in render()
692 context.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); in render()
693 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
696 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
697 context.enable(GL_DEPTH_TEST); in render()
698 sglr::drawQuad(context, texShaderID, Vec3(0.5f, 0.5f, 0.5f), Vec3(1.0f, 1.0f, 0.5f)); in render()
699 context.disable(GL_DEPTH_TEST); in render()
703 flatShader.setColor(context, flatShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
706 context.enable(GL_SCISSOR_TEST); in render()
707 context.scissor(10, 10, 12, 25); in render()
708 context.clearStencil(1); in render()
709 context.clear(GL_STENCIL_BUFFER_BIT); in render()
710 context.disable(GL_SCISSOR_TEST); in render()
713 context.enable(GL_STENCIL_TEST); in render()
714 context.stencilFunc(GL_EQUAL, 1, 0xffu); in render()
715 sglr::drawQuad(context, flatShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
716 context.disable(GL_STENCIL_TEST); in render()
722 texShader.setUniforms(context, texShaderID); in render()
724 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
725 context.bindTexture(GL_TEXTURE_2D, fboA.getColorBuffer()); in render()
726 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
727 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
728 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
731 …readPixels(context, dst, 0, 0, width, height, glu::mapGLInternalFormat(fboA.getConfig().colorForma… in render()
737 SharedColorbufferClearsTest (Context& context, const FboConfig& config);
740 void render (sglr::Context& context, Surface& dst);
743 SharedColorbufferClearsTest::SharedColorbufferClearsTest (Context& context, const FboConfig& config) in SharedColorbufferClearsTest() argument
744 : FboRenderCase (context, config.getName().c_str(), "Shared colorbuffer clears", config) in SharedColorbufferClearsTest()
748 void SharedColorbufferClearsTest::render (sglr::Context& context, Surface& dst) in render() argument
757 checkColorFormatSupport(context, m_config.colorFormat); in render()
762 context.bindTexture(GL_TEXTURE_2D, colorbuffer); in render()
763 context.texImage2D(GL_TEXTURE_2D, 0, m_config.colorFormat, width, height); in render()
764 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); in render()
765 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); in render()
770 context.bindRenderbuffer(GL_RENDERBUFFER, colorbuffer); in render()
771 context.renderbufferStorage(GL_RENDERBUFFER, m_config.colorFormat, width, height); in render()
777 context.bindFramebuffer(GL_FRAMEBUFFER, fbo); in render()
780 … context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorbuffer, 0); in render()
782 …context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer… in render()
785 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
789 GLenum status = context.checkFramebufferStatus(GL_FRAMEBUFFER); in render()
795 context.viewport(0, 0, width, height); in render()
796 context.clearColor(0.0f, 0.0f, 1.0f, 1.0f); in render()
797 context.clear(GL_COLOR_BUFFER_BIT); in render()
799 context.enable(GL_SCISSOR_TEST); in render()
801 context.bindFramebuffer(GL_FRAMEBUFFER, 2); in render()
802 context.clearColor(0.6f, 0.0f, 0.0f, 1.0f); in render()
803 context.scissor(10, 10, 64, 64); in render()
804 context.clear(GL_COLOR_BUFFER_BIT); in render()
805 context.clearColor(0.0f, 0.6f, 0.0f, 1.0f); in render()
806 context.scissor(60, 60, 40, 20); in render()
807 context.clear(GL_COLOR_BUFFER_BIT); in render()
809 context.bindFramebuffer(GL_FRAMEBUFFER, 3); in render()
810 context.clearColor(0.0f, 0.0f, 0.6f, 1.0f); in render()
811 context.scissor(20, 20, 100, 10); in render()
812 context.clear(GL_COLOR_BUFFER_BIT); in render()
814 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
815 context.clearColor(0.6f, 0.0f, 0.6f, 1.0f); in render()
816 context.scissor(20, 20, 5, 100); in render()
817 context.clear(GL_COLOR_BUFFER_BIT); in render()
819 context.disable(GL_SCISSOR_TEST); in render()
824 deUint32 shaderID = context.createProgram(&shader); in render()
826 shader.setUniforms(context, shaderID); in render()
828 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
829 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
830 sglr::drawQuad(context, shaderID, Vec3(-0.9f, -0.9f, 0.0f), Vec3(0.9f, 0.9f, 0.0f)); in render()
831 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
834 readPixels(context, dst, 0, 0, width, height, colorFormat, Vec4(1.0f), Vec4(0.0f)); in render()
840 SharedDepthStencilTest (Context& context, const FboConfig& config);
844 void render (sglr::Context& context, Surface& dst);
847 SharedDepthStencilTest::SharedDepthStencilTest (Context& context, const FboConfig& config) in SharedDepthStencilTest() argument
848 : FboRenderCase (context, config.getName().c_str(), "Shared depth/stencilbuffer", config) in SharedDepthStencilTest()
857 void SharedDepthStencilTest::render (sglr::Context& context, Surface& dst) in render() argument
861 deUint32 texShaderID = context.createProgram(&texShader); in render()
862 deUint32 flatShaderID = context.createProgram(&flatShader); in render()
871 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
872 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
874 context.viewport(0, 0, width, height); in render()
877 Framebuffer fboA(context, m_config, width, height); in render()
885 Framebuffer fboB(context, cfg, width, height); in render()
888 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
899 …case GL_TEXTURE_2D: context.framebufferTexture2D(GL_FRAMEBUFFER, point, GL_TEXTURE_2D, fboA.getDe… in render()
900 …case GL_RENDERBUFFER: context.framebufferRenderbuffer(GL_FRAMEBUFFER, point, GL_RENDERBUFFER, fboA… in render()
907 texShader.setUniforms(context, texShaderID); in render()
910 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f); in render()
911 context.clearStencil(1); in render()
912 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
914 context.enable(GL_DEPTH_TEST); in render()
917 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
918 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
919 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
924 context.enable(GL_SCISSOR_TEST); in render()
925 context.scissor(10, 10, 12, 25); in render()
926 context.clearStencil(0); in render()
927 context.clear(GL_STENCIL_BUFFER_BIT); in render()
928 context.disable(GL_SCISSOR_TEST); in render()
932 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
933 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
934 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, -1.0f), Vec3(1.0f, 1.0f, 1.0f)); in render()
936 context.disable(GL_DEPTH_TEST); in render()
941 context.enable(GL_STENCIL_TEST); in render()
942 context.stencilFunc(GL_EQUAL, 0, 0xffu); in render()
943 context.useProgram(flatShaderID); in render()
944 flatShader.setColor(context, flatShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
945 sglr::drawQuad(context, flatShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
946 context.disable(GL_STENCIL_TEST); in render()
952 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
953 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
954 context.bindTexture(GL_TEXTURE_2D, fboA.getColorBuffer()); in render()
955 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); in render()
956 context.bindTexture(GL_TEXTURE_2D, fboB.getColorBuffer()); in render()
957 sglr::drawQuad(context, texShaderID, Vec3(0.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
959 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
964 …readPixels(context, dst, 0, 0, width, height, glu::mapGLInternalFormat(m_config.colorFormat), Vec4… in render()
972 TexSubImageAfterRenderTest (Context& context, const FboConfig& config);
975 void render (sglr::Context& context, Surface& dst);
978 TexSubImageAfterRenderTest::TexSubImageAfterRenderTest (Context& context, const FboConfig& config)
979 …: FboRenderCase(context, (string("after_render_") + config.getName()).c_str(), "TexSubImage after …
983 void TexSubImageAfterRenderTest::render (sglr::Context& context, Surface& dst)
996 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex);
997 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
998 context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, fourQuads);
1000 context.bindFramebuffer(GL_FRAMEBUFFER, 1);
1003 context.bindTexture(GL_TEXTURE_2D, fboTex);
1004 context.texImage2D(GL_TEXTURE_2D, 0, isRGBA ? GL_RGBA : GL_RGB, 128, 128);
1005 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1006 context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0);
1009 context.viewport(0, 0, 128, 128);
1010 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex);
1011 context.draw(TexturedQuadOp(-1.0f, -1.0f, 1.0f, 1.0f, 0));
1014 context.bindTexture(GL_TEXTURE_2D, fboTex);
1015 context.texSubImage2D(GL_TEXTURE_2D, 0, 32, 32, metaballs);
1018 context.bindFramebuffer(GL_FRAMEBUFFER, 0);
1019 context.viewport(0, 0, context.getWidth(), context.getHeight());
1020 context.draw(TexturedQuadOp(-1.0f, -1.0f, 1.0f, 1.0f, 0));
1021 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight());
1027 TexSubImageBetweenRenderTest (Context& context, const FboConfig& config);
1030 void render (sglr::Context& context, Surface& dst);
1033 TexSubImageBetweenRenderTest::TexSubImageBetweenRenderTest (Context& context, const FboConfig& conf…
1034 …: FboRenderCase(context, (string("between_render_") + config.getName()).c_str(), "TexSubImage betw…
1038 void TexSubImageBetweenRenderTest::render (sglr::Context& context, Surface& dst)
1055 context.bindTexture(GL_TEXTURE_2D, metaballsTex);
1056 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1057 context.texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, metaballs2);
1060 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex);
1061 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1062 context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, fourQuads);
1064 context.bindFramebuffer(GL_FRAMEBUFFER, 1);
1067 context.bindTexture(GL_TEXTURE_2D, fboTex);
1068 context.texImage2D(GL_TEXTURE_2D, 0, isRGBA ? GL_RGBA : GL_RGB, 128, 128);
1069 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1070 context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0);
1073 context.viewport(0, 0, 128, 128);
1074 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex);
1075 context.draw(TexturedQuadOp(-1.0f, -1.0f, 1.0f, 1.0f, 0));
1078 context.bindTexture(GL_TEXTURE_2D, fboTex);
1079 context.texSubImage2D(GL_TEXTURE_2D, 0, 32, 32, metaballs);
1082 context.bindTexture(GL_TEXTURE_2D, metaballsTex);
1083 context.draw(BlendTextureOp(0));
1086 context.bindFramebuffer(GL_FRAMEBUFFER, 0);
1087 context.viewport(0, 0, context.getWidth(), context.getHeight());
1088 context.bindTexture(GL_TEXTURE_2D, fboTex);
1089 context.draw(TexturedQuadOp(-1.0f, -1.0f, 1.0f, 1.0f, 0));
1091 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight());
1098 ResizeTest (Context& context, const FboConfig& config);
1101 void render (sglr::Context& context, Surface& dst);
1104 ResizeTest::ResizeTest (Context& context, const FboConfig& config) in ResizeTest() argument
1105 : FboRenderCase (context, config.getName().c_str(), "Resize framebuffer", config) in ResizeTest()
1109 void ResizeTest::render (sglr::Context& context, Surface& dst) in render() argument
1121 deUint32 texToFboShaderID = context.createProgram(&texToFboShader); in render()
1122 deUint32 texFromFboShaderID = context.createProgram(&texFromFboShader); in render()
1123 deUint32 flatShaderID = context.createProgram(&flatShader); in render()
1137 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1138 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 32, 32); in render()
1140 Framebuffer fbo(context, m_config, initialWidth, initialHeight); in render()
1144 texToFboShader.setUniforms (context, texToFboShaderID); in render()
1145 texFromFboShader.setUniforms(context, texFromFboShaderID); in render()
1146 …flatShader.setColor (context, flatShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f) * fboOutScale + fboOutB… in render()
1149 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1150 context.viewport(0, 0, initialWidth, initialHeight); in render()
1151 clearColorBuffer(context, colorFormat, tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f)); in render()
1152 context.clear(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1153 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1154 sglr::drawQuad(context, texToFboShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1159 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1160 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1161 context.bindTexture(GL_TEXTURE_2D, fbo.getColorBuffer()); in render()
1162 sglr::drawQuad(context, texFromFboShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1165 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1172 context.bindTexture(GL_TEXTURE_2D, fbo.getColorBuffer()); in render()
1173 context.texImage2D(GL_TEXTURE_2D, 0, fbo.getConfig().colorFormat, newWidth, newHeight); in render()
1177 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getColorBuffer()); in render()
1178 context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().colorFormat, newWidth, newHeight); in render()
1190 context.bindTexture(GL_TEXTURE_2D, fbo.getDepthStencilBuffer()); in render()
1191 context.texImage2D(GL_TEXTURE_2D, 0, fbo.getConfig().depthStencilFormat, newWidth, newHeight); in render()
1195 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getDepthStencilBuffer()); in render()
1196 …context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().depthStencilFormat, newWidth, newHeig… in render()
1205 context.viewport(0, 0, newWidth, newHeight); in render()
1206 clearColorBuffer(context, colorFormat, tcu::Vec4(1.0f, 0.0f, 0.0f, 1.0f)); in render()
1207 context.clear(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1209 context.enable(GL_DEPTH_TEST); in render()
1211 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1212 sglr::drawQuad(context, texToFboShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
1214 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1215 sglr::drawQuad(context, texToFboShaderID, Vec3(0.0f, 0.0f, -1.0f), Vec3(+1.0f, +1.0f, 1.0f)); in render()
1217 context.disable(GL_DEPTH_TEST); in render()
1221 context.enable(GL_SCISSOR_TEST); in render()
1222 context.clearStencil(1); in render()
1223 context.scissor(10, 10, 5, 15); in render()
1224 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1225 context.disable(GL_SCISSOR_TEST); in render()
1227 context.enable(GL_STENCIL_TEST); in render()
1228 context.stencilFunc(GL_EQUAL, 1, 0xffu); in render()
1229 sglr::drawQuad(context, flatShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
1230 context.disable(GL_STENCIL_TEST); in render()
1235 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1236 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1237 context.bindTexture(GL_TEXTURE_2D, fbo.getColorBuffer()); in render()
1238 sglr::drawQuad(context, texFromFboShaderID, Vec3(-0.5f, -0.5f, 0.0f), Vec3(0.5f, 0.5f, 0.0f)); in render()
1239 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1242 …readPixels(context, dst, 0, 0, newWidth, newHeight, colorFormat, fboRangeInfo.lookupScale, fboRang… in render()
1248 … RecreateBuffersTest (Context& context, const FboConfig& config, deUint32 buffers, bool rebind);
1251 void render (sglr::Context& context, Surface& dst);
1258 RecreateBuffersTest::RecreateBuffersTest (Context& context, const FboConfig& config, deUint32 buffe… in RecreateBuffersTest() argument
1259 …: FboRenderCase (context, (string(config.getName()) + (rebind ? "" : "_no_rebind")).c_str(), "Rec… in RecreateBuffersTest()
1448 FboRenderTestGroup::FboRenderTestGroup (Context& context) in FboRenderTestGroup() argument
1449 : TestCaseGroup(context, "render", "Rendering Tests") in FboRenderTestGroup()