Lines Matching defs:context
342 void setUniforms (sglr::Context& context, deUint32 program) const;
347 void shadeFragments (rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const;
620 void MultiTexShader::shadeFragments (rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const
639 rr::readTriangleVarying<float>(packet, context, 0, 0).xy(),
640 rr::readTriangleVarying<float>(packet, context, 0, 1).xy(),
641 rr::readTriangleVarying<float>(packet, context, 0, 2).xy(),
642 rr::readTriangleVarying<float>(packet, context, 0, 3).xy(),
681 rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, outColors[fragNdx]);
698 TextureUnitCase (Context& context, const char* name, const char* desc, int numUnits /* \note If non-positive, use all units */, CaseType caseType, deUint32 randSeed);
719 void upload2dTexture (int texNdx, sglr::Context& context);
720 void uploadCubeTexture (int texNdx, sglr::Context& context);
721 void upload2dArrayTexture (int texNdx, sglr::Context& context);
722 void upload3dTexture (int texNdx, sglr::Context& context);
724 void render (sglr::Context& context);
744 TextureUnitCase::TextureUnitCase (Context& context, const char* name, const char* desc, int numUnits, CaseType caseType, deUint32 randSeed)
745 : TestCase (context, tcu::NODETYPE_SELF_VALIDATE, name, desc)
1029 sglr::GLContext context(renderCtx, log, sglr::GLCONTEXT_LOG_CALLS|sglr::GLCONTEXT_LOG_PROGRAMS, tcu::IVec4(viewportX, viewportY, viewportWidth, viewportHeight));
1031 render(context);
1033 context.readPixels(gles3Frame, 0, 0, viewportWidth, viewportHeight);
1039 sglr::ReferenceContext context (sglr::ReferenceContextLimits(renderCtx), buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
1041 render(context);
1043 context.readPixels(refFrame, 0, 0, viewportWidth, viewportHeight);
1057 void TextureUnitCase::upload2dTexture (int texNdx, sglr::Context& context)
1063 context.pixelStorei(GL_UNPACK_ALIGNMENT, 1);
1076 context.texImage2D(GL_TEXTURE_2D, levelNdx, m_textureParams[texNdx].internalFormat, width, height, 0 /* border */, formatGl.format, formatGl.dataType, access.getDataPtr());
1077 GLU_EXPECT_NO_ERROR(context.getError(), "Set 2d texture image data");
1081 void TextureUnitCase::uploadCubeTexture (int texNdx, sglr::Context& context)
1087 context.pixelStorei(GL_UNPACK_ALIGNMENT, 1);
1102 context.texImage2D(s_cubeFaceTargets[face], levelNdx, m_textureParams[texNdx].internalFormat, width, height, 0 /* border */, formatGl.format, formatGl.dataType, access.getDataPtr());
1103 GLU_EXPECT_NO_ERROR(context.getError(), "Set cube map image data");
1108 void TextureUnitCase::upload2dArrayTexture (int texNdx, sglr::Context& context)
1114 context.pixelStorei(GL_UNPACK_ALIGNMENT, 1);
1129 context.texImage3D(GL_TEXTURE_2D_ARRAY, levelNdx, m_textureParams[texNdx].internalFormat, width, height, layers, 0 /* border */, formatGl.format, formatGl.dataType, access.getDataPtr());
1130 GLU_EXPECT_NO_ERROR(context.getError(), "Set 2d array texture image data");
1134 void TextureUnitCase::upload3dTexture (int texNdx, sglr::Context& context)
1140 context.pixelStorei(GL_UNPACK_ALIGNMENT, 1);
1155 context.texImage3D(GL_TEXTURE_3D, levelNdx, m_textureParams[texNdx].internalFormat, width, height, depth, 0 /* border */, formatGl.format, formatGl.dataType, access.getDataPtr());
1156 GLU_EXPECT_NO_ERROR(context.getError(), "Set 3d texture image data");
1160 void TextureUnitCase::render (sglr::Context& context)
1168 context.genTextures(m_numTextures, &textureGLNames[0]);
1169 GLU_EXPECT_NO_ERROR(context.getError(), "Generate textures");
1176 context.activeTexture(GL_TEXTURE0 + unitNdx);
1177 GLU_EXPECT_NO_ERROR(context.getError(), "Set active texture");
1178 context.bindTexture(m_textureTypes[texNdx], textureGLNames[texNdx]);
1179 GLU_EXPECT_NO_ERROR(context.getError(), "Bind texture");
1185 context.texParameteri(m_textureTypes[texNdx], GL_TEXTURE_WRAP_S, m_textureParams[texNdx].wrapModeS);
1186 context.texParameteri(m_textureTypes[texNdx], GL_TEXTURE_WRAP_T, m_textureParams[texNdx].wrapModeT);
1188 context.texParameteri(m_textureTypes[texNdx], GL_TEXTURE_WRAP_R, m_textureParams[texNdx].wrapModeR);
1189 context.texParameteri(m_textureTypes[texNdx], GL_TEXTURE_MIN_FILTER, m_textureParams[texNdx].minFilter);
1190 context.texParameteri(m_textureTypes[texNdx], GL_TEXTURE_MAG_FILTER, m_textureParams[texNdx].magFilter);
1191 GLU_EXPECT_NO_ERROR(context.getError(), "Set texture parameters");
1195 case GL_TEXTURE_2D: upload2dTexture(texNdx, context); break;
1196 case GL_TEXTURE_CUBE_MAP: uploadCubeTexture(texNdx, context); break;
1197 case GL_TEXTURE_2D_ARRAY: upload2dArrayTexture(texNdx, context); break;
1198 case GL_TEXTURE_3D: upload3dTexture(texNdx, context); break;
1207 GLU_EXPECT_NO_ERROR(context.getError(), "Set textures");
1211 deUint32 shaderID = context.createProgram(m_shader);
1215 context.clearColor(0.125f, 0.25f, 0.5f, 1.0f);
1216 context.clear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
1217 m_shader->setUniforms(context, shaderID);
1218 sglr::drawQuad(context, shaderID, Vec3(-1.0f, -1.0f, 0.0f), Vec3(1.0f, 1.0f, 0.0f));
1219 GLU_EXPECT_NO_ERROR(context.getError(), "Draw");
1223 context.deleteTextures(m_numTextures, &textureGLNames[0]);
1224 GLU_EXPECT_NO_ERROR(context.getError(), "Delete textures");
1227 TextureUnitTests::TextureUnitTests (Context& context)
1228 : TestCaseGroup(context, "units", "Texture Unit Usage Tests")