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()
721 context.colorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); in render()
722 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
723 context.clear(GL_COLOR_BUFFER_BIT); in render()
724 context.colorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); in render()
728 context.readPixels(dst, 0, 0, width, height); in render()
735 IntersectingQuadsTest (Context& context, const FboConfig& config, bool npot = false);
738 virtual void render (sglr::Context& context, Surface& dst);
750 IntersectingQuadsNpotTest (Context& context, const FboConfig& config) in IntersectingQuadsNpotTest() argument
751 : IntersectingQuadsTest(context, config, true) in IntersectingQuadsNpotTest()
756 IntersectingQuadsTest::IntersectingQuadsTest (Context& context, const FboConfig& config, bool npot) in IntersectingQuadsTest() argument
757 …: FboRenderCase (context, (string(npot ? "npot_" : "") + config.getName()).c_str(), "Intersecting … in IntersectingQuadsTest()
828 MixTest (Context& context, const FboConfig& config, bool npot = false);
831 void render (sglr::Context& context, Surface& dst);
845 MixNpotTest (Context& context, const FboConfig& config) in MixNpotTest() argument
846 : MixTest(context, config, true) in MixNpotTest()
851 MixTest::MixTest (Context& context, const FboConfig& config, bool npot) in MixTest() argument
852 …: FboRenderCase (context, (string(npot ? "mix_npot_" : "mix_") + config.getName()).c_str(), "Use t… in MixTest()
867 void MixTest::render (sglr::Context& context, Surface& dst) in render() argument
872 deUint32 singleTexShaderID = context.createProgram(&singleTexShader); in render()
873 deUint32 mixShaderID = context.createProgram(&mixShader); in render()
877 context.pixelStorei(GL_UNPACK_ALIGNMENT, 1); in render()
878 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
881 singleTexShader.setUnit(context, singleTexShaderID, 0); in render()
882 mixShader.setUnits(context, mixShaderID, 0, 1); in render()
885 Framebuffer fboA(context, getConfig(), m_fboAWidth, m_fboAHeight); in render()
887 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
888 context.viewport(0, 0, m_fboAWidth, m_fboAHeight); in render()
889 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
890 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
891 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
892 sglr::drawQuad(context, singleTexShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
895 Framebuffer fboB(context, getConfig(), m_fboBWidth, m_fboBHeight); in render()
897 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
898 context.viewport(0, 0, m_fboBWidth, m_fboBHeight); in render()
899 context.enable(GL_SCISSOR_TEST); in render()
900 context.scissor(0, 0, 32, 64); in render()
901 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f); in render()
902 context.clear(GL_COLOR_BUFFER_BIT); in render()
903 context.scissor(32, 0, 32, 64); in render()
904 context.clearColor(0.0f, 1.0f, 0.0f, 1.0f); in render()
905 context.clear(GL_COLOR_BUFFER_BIT); in render()
906 context.disable(GL_SCISSOR_TEST); in render()
909 context.activeTexture(GL_TEXTURE0); in render()
910 context.bindTexture(GL_TEXTURE_2D, fboA.getColorbuffer()); in render()
911 context.activeTexture(GL_TEXTURE1); in render()
912 context.bindTexture(GL_TEXTURE_2D, fboB.getColorbuffer()); in render()
913 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
914 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
915 sglr::drawQuad(context, mixShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
917 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
923 BlendTest (Context& context, const FboConfig& config, bool npot = false);
926 void render (sglr::Context& context, Surface& dst);
938 BlendNpotTest (Context& context, const FboConfig& config) in BlendNpotTest() argument
939 : BlendTest(context, config, true) in BlendNpotTest()
944 BlendTest::BlendTest (Context& context, const FboConfig& config, bool npot) in BlendTest() argument
945 …: FboRenderCase (context, (string(npot ? "blend_npot_" : "blend_") + config.getName()).c_str(), "B… in BlendTest()
957 void BlendTest::render (sglr::Context& context, Surface& dst) in render() argument
960 deUint32 shaderID = context.createProgram(&shader); in render()
965 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, 64, 64); in render()
967 Framebuffer fbo(context, getConfig(), width, height); in render()
970 shader.setUnit(context, shaderID, 0); in render()
972 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
973 context.viewport(0, 0, width, height); in render()
974 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
975 context.clearColor(0.6f, 0.0f, 0.6f, 1.0f); in render()
976 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
978 context.enable(GL_BLEND); in render()
979 context.blendEquation(GL_FUNC_ADD); in render()
980 context.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); in render()
981 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
982 context.disable(GL_BLEND); in render()
986 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
987 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
988 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
989 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
990 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
993 context.readPixels(dst, 0, 0, width, height); in render()
999 StencilClearsTest (Context& context, const FboConfig& config);
1002 void render (sglr::Context& context, Surface& dst);
1007 StencilClearsTest::StencilClearsTest (Context& context, const FboConfig& config) in StencilClearsTest() argument
1008 : FboRenderCase(context, config.getName().c_str(), "Stencil clears", config) in StencilClearsTest()
1012 void StencilClearsTest::render (sglr::Context& context, Surface& dst) in render() argument
1015 deUint32 shaderID = context.createProgram(&shader); in render()
1021 createQuadsTex2D(context, quadsTex, GL_RGBA, GL_UNSIGNED_BYTE, width, height); in render()
1022 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, width, height); in render()
1024 Framebuffer fbo(context, getConfig(), width, height); in render()
1028 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1029 context.viewport(0, 0, width, height); in render()
1030 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1031 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1034 context.enable(GL_SCISSOR_TEST); in render()
1035 context.scissor(10, 16, 32, 120); in render()
1036 context.clearStencil(1); in render()
1037 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1038 context.scissor(16, 32, 100, 64); in render()
1039 context.clearStencil(2); in render()
1040 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1041 context.disable(GL_SCISSOR_TEST); in render()
1044 context.activeTexture(GL_TEXTURE0); in render()
1045 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1046 context.activeTexture(GL_TEXTURE1); in render()
1047 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1049 context.enable(GL_STENCIL_TEST); in render()
1050 context.stencilFunc(GL_EQUAL, 1, 0xffffffffu); in render()
1051 shader.setUnit(context, shaderID, 0); in render()
1052 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1054 context.stencilFunc(GL_EQUAL, 2, 0xffffffffu); in render()
1055 shader.setUnit(context, shaderID, 1); in render()
1056 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1058 context.disable(GL_STENCIL_TEST); in render()
1062 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1063 context.activeTexture(GL_TEXTURE0); in render()
1064 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1065 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1066 shader.setUnit(context, shaderID, 0); in render()
1067 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1068 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1076 context.colorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); in render()
1077 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1078 context.clear(GL_COLOR_BUFFER_BIT); in render()
1079 context.colorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); in render()
1082 context.readPixels(dst, 0, 0, width, height); in render()
1094 StencilTest (Context& context, const FboConfig& config, bool npot = false);
1097 void render (sglr::Context& context, Surface& dst);
1109 StencilNpotTest (Context& context, const FboConfig& config) in StencilNpotTest() argument
1110 : StencilTest(context, config, true) in StencilNpotTest()
1115 StencilTest::StencilTest (Context& context, const FboConfig& config, bool npot) in StencilTest() argument
1116 …: FboRenderCase (context, (string(npot ? "npot_" : "") + config.getName()).c_str(), "Stencil ops",… in StencilTest()
1197 SharedColorbufferTest (Context& context, const FboConfig& config);
1200 void render (sglr::Context& context, Surface& dst);
1203 SharedColorbufferTest::SharedColorbufferTest (Context& context, const FboConfig& config) in SharedColorbufferTest() argument
1204 : FboRenderCase(context, config.getName().c_str(), "Shared colorbuffer", config) in SharedColorbufferTest()
1208 void SharedColorbufferTest::render (sglr::Context& context, Surface& dst) in render() argument
1211 deUint32 shaderID = context.createProgram(&shader); in render()
1220 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1221 createMetaballsTex2D(context, metaballsTex, GL_RGBA, GL_UNSIGNED_BYTE, 64, 64); in render()
1223 context.viewport(0, 0, width, height); in render()
1225 shader.setUnit(context, shaderID, 0); in render()
1228 Framebuffer fboA(context, getConfig(), width, height); in render()
1235 Framebuffer fboB(context, cfg, width, height); in render()
1238 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1242context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboA.getColorbuf… in render()
1246context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, fboA.getCol… in render()
1254 context.clear(GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1257 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
1258 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1259 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1260 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1265 context.clearStencil(1); in render()
1266 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1269 context.enable(GL_DEPTH_TEST); in render()
1270 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1271 context.disable(GL_DEPTH_TEST); in render()
1274 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1275 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1276 context.enable(GL_BLEND); in render()
1277 context.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); in render()
1278 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1281 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1282 context.enable(GL_DEPTH_TEST); in render()
1283 sglr::drawQuad(context, shaderID, Vec3(0.5f, 0.5f, 0.5f), Vec3(1.0f, 1.0f, 0.5f)); in render()
1284 context.disable(GL_DEPTH_TEST); in render()
1289 deUint32 flatShaderID = context.createProgram(&flatShader); in render()
1291 flatShader.setColor(context, flatShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
1294 context.enable(GL_SCISSOR_TEST); in render()
1295 context.scissor(10, 10, 12, 25); in render()
1296 context.clearStencil(1); in render()
1297 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1298 context.disable(GL_SCISSOR_TEST); in render()
1301 context.enable(GL_STENCIL_TEST); in render()
1302 context.stencilFunc(GL_EQUAL, 1, 0xffu); in render()
1303 sglr::drawQuad(context, flatShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1304 context.disable(GL_STENCIL_TEST); in render()
1310 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1311 context.bindTexture(GL_TEXTURE_2D, fboA.getColorbuffer()); in render()
1312 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1313 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1314 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1317 context.readPixels(dst, 0, 0, width, height); in render()
1323 SharedColorbufferClearsTest (Context& context, const FboConfig& config);
1327 void render (sglr::Context& context, Surface& dst);
1330 SharedColorbufferClearsTest::SharedColorbufferClearsTest (Context& context, const FboConfig& config) in SharedColorbufferClearsTest() argument
1331 : FboRenderCase(context, config.getName().c_str(), "Shared colorbuffer clears", config) in SharedColorbufferClearsTest()
1342 void SharedColorbufferClearsTest::render (sglr::Context& context, Surface& dst) in render() argument
1348 checkColorFormatSupport(context, getConfig().colorbufferFormat); in render()
1353 context.bindTexture(GL_TEXTURE_2D, colorbuffer); in render()
1354 context.texImage2D(GL_TEXTURE_2D, 0, getConfig().colorbufferFormat, width, height); in render()
1355 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1360 context.bindRenderbuffer(GL_RENDERBUFFER, colorbuffer); in render()
1361 context.renderbufferStorage(GL_RENDERBUFFER, getConfig().colorbufferFormat, width, height); in render()
1367 context.bindFramebuffer(GL_FRAMEBUFFER, fbo); in render()
1370context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorbuffer, 0); in render()
1372context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer… in render()
1375 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1379 GLenum status = context.checkFramebufferStatus(GL_FRAMEBUFFER); in render()
1385 context.viewport(0, 0, width, height); in render()
1386 context.clearColor(0.0f, 0.0f, 1.0f, 1.0f); in render()
1387 context.clear(GL_COLOR_BUFFER_BIT); in render()
1389 context.enable(GL_SCISSOR_TEST); in render()
1391 context.bindFramebuffer(GL_FRAMEBUFFER, 2); in render()
1392 context.clearColor(0.6f, 0.0f, 0.0f, 1.0f); in render()
1393 context.scissor(10, 10, 64, 64); in render()
1394 context.clear(GL_COLOR_BUFFER_BIT); in render()
1395 context.clearColor(0.0f, 0.6f, 0.0f, 1.0f); in render()
1396 context.scissor(60, 60, 40, 20); in render()
1397 context.clear(GL_COLOR_BUFFER_BIT); in render()
1399 context.bindFramebuffer(GL_FRAMEBUFFER, 3); in render()
1400 context.clearColor(0.0f, 0.0f, 0.6f, 1.0f); in render()
1401 context.scissor(20, 20, 100, 10); in render()
1402 context.clear(GL_COLOR_BUFFER_BIT); in render()
1404 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1405 context.clearColor(0.6f, 0.0f, 0.6f, 1.0f); in render()
1406 context.scissor(20, 20, 5, 100); in render()
1407 context.clear(GL_COLOR_BUFFER_BIT); in render()
1409 context.disable(GL_SCISSOR_TEST); in render()
1414 deUint32 shaderID = context.createProgram(&shader); in render()
1416 shader.setUnit(context, shaderID, 0); in render()
1418 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1419 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1420 sglr::drawQuad(context, shaderID, Vec3(-0.9f, -0.9f, 0.0f), Vec3(0.9f, 0.9f, 0.0f)); in render()
1421 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1424 context.readPixels(dst, 0, 0, width, height); in render()
1430 SharedDepthbufferTest (Context& context, const FboConfig& config);
1434 void render (sglr::Context& context, Surface& dst);
1437 SharedDepthbufferTest::SharedDepthbufferTest (Context& context, const FboConfig& config) in SharedDepthbufferTest() argument
1438 : FboRenderCase(context, config.getName().c_str(), "Shared depthbuffer", config) in SharedDepthbufferTest()
1447 void SharedDepthbufferTest::render (sglr::Context& context, Surface& dst) in render() argument
1451 deUint32 texShaderID = context.createProgram(&texShader); in render()
1452 deUint32 colorShaderID = context.createProgram(&colorShader); in render()
1458 texShader.setUnit(context, texShaderID, 0); in render()
1459 colorShader.setColor(context, colorShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
1464 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1465 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1467 context.viewport(0, 0, width, height); in render()
1470 Framebuffer fboA(context, getConfig(), width, height); in render()
1477 Framebuffer fboB(context, cfg, width, height); in render()
1481 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1482context.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fboA.getDept… in render()
1485 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f); in render()
1486 context.clearStencil(1); in render()
1487 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1490 context.enable(GL_DEPTH_TEST); in render()
1493 context.bindFramebuffer(GL_FRAMEBUFFER, fboA.getFramebuffer()); in render()
1494 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1495 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1496 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1497 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1500 context.bindFramebuffer(GL_FRAMEBUFFER, fboB.getFramebuffer()); in render()
1501 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1502 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, -1.0f), Vec3(1.0f, 1.0f, 1.0f)); in render()
1504 context.disable(GL_DEPTH_TEST); in render()
1509 context.enable(GL_SCISSOR_TEST); in render()
1510 context.scissor(10, 10, 12, 25); in render()
1511 context.clearStencil(0); in render()
1512 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1513 context.disable(GL_SCISSOR_TEST); in render()
1516 context.enable(GL_STENCIL_TEST); in render()
1517 context.stencilFunc(GL_EQUAL, 0, 0xffu); in render()
1518 sglr::drawQuad(context, colorShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1519 context.disable(GL_STENCIL_TEST); in render()
1525 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1526 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1527 context.bindTexture(GL_TEXTURE_2D, fboA.getColorbuffer()); in render()
1528 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); in render()
1529 context.bindTexture(GL_TEXTURE_2D, fboB.getColorbuffer()); in render()
1530 sglr::drawQuad(context, texShaderID, Vec3(0.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1532 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1537 context.readPixels(dst, 0, 0, width, height); in render()
1544 TexSubImageAfterRenderTest (Context& context, const FboConfig& config);
1548 void render (sglr::Context& context, Surface& dst);
1551 TexSubImageAfterRenderTest::TexSubImageAfterRenderTest (Context& context, const FboConfig& config) in TexSubImageAfterRenderTest() argument
1552 …: FboRenderCase(context, (string("after_render_") + config.getName()).c_str(), "TexSubImage after … in TexSubImageAfterRenderTest()
1564 void TexSubImageAfterRenderTest::render (sglr::Context& context, Surface& dst) in render() argument
1567 deUint32 shaderID = context.createProgram(&shader); in render()
1576 shader.setUnit(context, shaderID, 0); in render()
1579 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1580 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1581context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, fourQuads.getAcc… in render()
1583 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1586 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1587 context.texImage2D(GL_TEXTURE_2D, 0, isRGBA ? GL_RGBA : GL_RGB, 128, 128); in render()
1588 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1589 context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0); in render()
1592 context.viewport(0, 0, 128, 128); in render()
1593 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1594 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1597 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1598context.texSubImage2D(GL_TEXTURE_2D, 0, 32, 32, 64, 64, isRGBA ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYT… in render()
1601 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1602 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1603 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1604 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1610 TexSubImageBetweenRenderTest (Context& context, const FboConfig& config);
1614 void render (sglr::Context& context, Surface& dst);
1617 TexSubImageBetweenRenderTest::TexSubImageBetweenRenderTest (Context& context, const FboConfig& conf… in TexSubImageBetweenRenderTest() argument
1618 …: FboRenderCase(context, (string("between_render_") + config.getName()).c_str(), "TexSubImage betw… in TexSubImageBetweenRenderTest()
1630 void TexSubImageBetweenRenderTest::render (sglr::Context& context, Surface& dst) in render() argument
1633 deUint32 shaderID = context.createProgram(&shader); in render()
1646 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1647 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1648context.texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, metaballs2.get… in render()
1651 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1652 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1653context.texImage2D(GL_TEXTURE_2D, 0, GL_RGB, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, fourQuads.getAcc… in render()
1655 context.bindFramebuffer(GL_FRAMEBUFFER, 1); in render()
1658 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1659 context.texImage2D(GL_TEXTURE_2D, 0, isRGBA ? GL_RGBA : GL_RGB, 128, 128); in render()
1660 context.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); in render()
1661 context.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0); in render()
1663 shader.setUnit(context, shaderID, 0); in render()
1666 context.viewport(0, 0, 128, 128); in render()
1667 context.bindTexture(GL_TEXTURE_2D, fourQuadsTex); in render()
1668 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1671 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1672context.texSubImage2D(GL_TEXTURE_2D, 0, 32, 32, 64, 64, isRGBA ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYT… in render()
1675 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1676 context.enable(GL_BLEND); in render()
1677 context.blendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); in render()
1678 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1679 context.disable(GL_BLEND); in render()
1682 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1683 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1684 context.bindTexture(GL_TEXTURE_2D, fboTex); in render()
1685 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1687 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1693 ResizeTest (Context& context, const FboConfig& config);
1696 void render (sglr::Context& context, Surface& dst);
1699 ResizeTest::ResizeTest (Context& context, const FboConfig& config) in ResizeTest() argument
1700 : FboRenderCase(context, config.getName().c_str(), "Resize framebuffer", config) in ResizeTest()
1704 void ResizeTest::render (sglr::Context& context, Surface& dst) in render() argument
1708 deUint32 texShaderID = context.createProgram(&texShader); in render()
1709 deUint32 colorShaderID = context.createProgram(&colorShader); in render()
1715 createQuadsTex2D(context, quadsTex, GL_RGB, GL_UNSIGNED_BYTE, 64, 64); in render()
1716 createMetaballsTex2D(context, metaballsTex, GL_RGB, GL_UNSIGNED_BYTE, 32, 32); in render()
1718 Framebuffer fbo(context, getConfig(), 128, 128); in render()
1722 texShader.setUnit(context, texShaderID, 0); in render()
1723 colorShader.setColor(context, colorShaderID, Vec4(0.0f, 1.0f, 0.0f, 1.0f)); in render()
1726 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1727 context.viewport(0, 0, 128, 128); in render()
1728 context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); in render()
1729 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1730 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1731 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1736 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1737 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1738 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1739 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f)); in render()
1742 context.bindFramebuffer(GL_FRAMEBUFFER, fbo.getFramebuffer()); in render()
1752 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1753 context.texImage2D(GL_TEXTURE_2D, 0, fbo.getConfig().colorbufferFormat, newWidth, newHeight); in render()
1757 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getColorbuffer()); in render()
1758context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().colorbufferFormat, newWidth, newHeigh… in render()
1768 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getDepthbuffer()); in render()
1769context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().depthbufferFormat, newWidth, newHeigh… in render()
1775 context.bindRenderbuffer(GL_RENDERBUFFER, fbo.getStencilbuffer()); in render()
1776context.renderbufferStorage(GL_RENDERBUFFER, fbo.getConfig().stencilbufferFormat, newWidth, newHei… in render()
1780 context.viewport(0, 0, newWidth, newHeight); in render()
1781 context.clearColor(1.0f, 0.0f, 0.0f, 1.0f); in render()
1782 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); in render()
1784 context.enable(GL_DEPTH_TEST); in render()
1786 context.bindTexture(GL_TEXTURE_2D, metaballsTex); in render()
1787 sglr::drawQuad(context, texShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
1789 context.bindTexture(GL_TEXTURE_2D, quadsTex); in render()
1790 sglr::drawQuad(context, texShaderID, Vec3(0.0f, 0.0f, -1.0f), Vec3(+1.0f, +1.0f, 1.0f)); in render()
1792 context.disable(GL_DEPTH_TEST); in render()
1796 context.enable(GL_SCISSOR_TEST); in render()
1797 context.scissor(10, 10, 5, 15); in render()
1798 context.clearStencil(1); in render()
1799 context.clear(GL_STENCIL_BUFFER_BIT); in render()
1800 context.disable(GL_SCISSOR_TEST); in render()
1802 context.enable(GL_STENCIL_TEST); in render()
1803 context.stencilFunc(GL_EQUAL, 1, 0xffu); in render()
1804 sglr::drawQuad(context, colorShaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(+1.0f, +1.0f, 0.0f)); in render()
1805 context.disable(GL_STENCIL_TEST); in render()
1810 context.bindFramebuffer(GL_FRAMEBUFFER, 0); in render()
1811 context.viewport(0, 0, context.getWidth(), context.getHeight()); in render()
1812 context.bindTexture(GL_TEXTURE_2D, fbo.getColorbuffer()); in render()
1813 sglr::drawQuad(context, texShaderID, Vec3(-0.5f, -0.5f, 0.0f), Vec3(0.5f, 0.5f, 0.0f)); in render()
1814 context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); in render()
1817 context.readPixels(dst, 0, 0, newWidth, newHeight); in render()
1824 RecreateBuffersTest (Context& context, const FboConfig& config, bool rebind);
1828 void render (sglr::Context& context, Surface& dst);
1838 RecreateBuffersNoRebindTest (Context& context, const FboConfig& config) in RecreateBuffersNoRebindTest() argument
1839 : RecreateBuffersTest<Buffers>(context, config, false) in RecreateBuffersNoRebindTest()
1848 RecreateBuffersRebindTest (Context& context, const FboConfig& config) in RecreateBuffersRebindTest() argument
1849 : RecreateBuffersTest<Buffers>(context, config, true) in RecreateBuffersRebindTest()
1855 RecreateBuffersTest<Buffers>::RecreateBuffersTest (Context& context, const FboConfig& config, bool … in RecreateBuffersTest() argument
1856 …: FboRenderCase (context, (string(rebind ? "rebind_" : "no_rebind_") + config.getName()).c_str(),… in RecreateBuffersTest()
2010 RepeatedClearCase (Context& context, deUint32 format) in RepeatedClearCase() argument
2011 …: FboRenderCase(context, makeConfig(format).getName().c_str(), "Repeated clears", makeConfig(forma… in RepeatedClearCase()
2082 FboRenderTestGroup::FboRenderTestGroup (Context& context) in FboRenderTestGroup() argument
2083 : TestCaseGroup(context, "render", "Rendering Tests") in FboRenderTestGroup()