Lines Matching refs:testCtx

54 static void logComment (tcu::TestContext& testCtx, const char* comment)
56 testCtx.getLog() << TestLog::Message << "// " << comment << TestLog::EndMessage;
59 static void checkError (tcu::TestContext& testCtx, sglr::Context& ctx, GLenum expect)
62 testCtx.getLog() << TestLog::Message << "// " << (result == expect ? "Pass" : "Fail") << ", expected " << glu::getErrorStr(expect) << TestLog::EndMessage;
65 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error code mismatch");
68 static void checkEitherError (tcu::TestContext& testCtx, sglr::Context& ctx, GLenum expectA, GLenum expectB)
73 testCtx.getLog() << TestLog::Message << "// " << (isOk ? "Pass" : "Fail") << ", expected " << glu::getErrorStr(expectA) << " or " << glu::getErrorStr(expectB) << TestLog::EndMessage;
76 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error code mismatch");
124 static void checkFboAttachmentParam (tcu::TestContext& testCtx, sglr::Context& ctx, GLenum attachment, GLenum pname, GLint expectedValue)
126 TestLog& log = testCtx.getLog();
139 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid result for attachment param query");
143 static void textureLevelsTest (tcu::TestContext& testCtx, sglr::Context& context)
153 testCtx.getLog() << TestLog::Message << "// GL_MAX_TEXTURE_SIZE is " << maxTexSize << ", floor(log2(" << maxTexSize << ")) = " << log2MaxTexSize << TestLog::EndMessage;
166 checkError(testCtx, context, levels[ndx] >= 0 && levels[ndx] <= log2MaxTexSize ? GL_NO_ERROR : GL_INVALID_VALUE);
170 static void validTex2DAttachmentsTest (tcu::TestContext& testCtx, sglr::Context& context)
186 checkError(testCtx, context, GL_NO_ERROR);
190 static void validTexCubeAttachmentsTest (tcu::TestContext& testCtx, sglr::Context& context)
218 checkError(testCtx, context, GL_NO_ERROR);
223 static void validRboAttachmentsTest (tcu::TestContext& testCtx, sglr::Context& context)
240 checkError(testCtx, context, GL_NO_ERROR);
244 static void attachToDefaultFramebufferTest (tcu::TestContext& testCtx, sglr::Context& context)
246 logComment(testCtx, "Attaching 2D texture to default framebuffer");
251 checkError(testCtx, context, GL_INVALID_OPERATION);
253 logComment(testCtx, "Attaching renderbuffer to default framebuffer");
258 checkError(testCtx, context, GL_INVALID_OPERATION);
261 static void invalidTex2DAttachmentTest (tcu::TestContext& testCtx, sglr::Context& context)
265 logComment(testCtx, "Attaching 2D texture using GL_TEXTURE_CUBE_MAP_NEGATIVE_X texture target");
270 checkError(testCtx, context, GL_INVALID_OPERATION);
272 logComment(testCtx, "Attaching deleted 2D texture object");
275 checkError(testCtx, context, GL_INVALID_OPERATION);
278 static void invalidTexCubeAttachmentTest (tcu::TestContext& testCtx, sglr::Context& context)
282 logComment(testCtx, "Attaching cube texture using GL_TEXTURE_2D texture target");
286 checkError(testCtx, context, GL_INVALID_OPERATION);
288 logComment(testCtx, "Attaching deleted cube texture object");
291 checkError(testCtx, context, GL_INVALID_OPERATION);
294 static void invalidRboAttachmentTest (tcu::TestContext& testCtx, sglr::Context& context)
298 logComment(testCtx, "Attaching renderbuffer using GL_FRAMEBUFFER renderbuffer target");
302 checkError(testCtx, context, GL_INVALID_ENUM);
304 logComment(testCtx, "Attaching deleted renderbuffer object");
307 checkError(testCtx, context, GL_INVALID_OPERATION);
310 static void attachNamesTest (tcu::TestContext& testCtx, sglr::Context& context)
318 logComment(testCtx, "Attaching allocated texture name to 2D target");
320 checkError(testCtx, context, GL_INVALID_OPERATION);
322 logComment(testCtx, "Attaching allocated texture name to cube target");
324 checkError(testCtx, context, GL_INVALID_OPERATION);
329 logComment(testCtx, "Attaching allocated renderbuffer name");
331 checkError(testCtx, context, GL_INVALID_OPERATION);
334 static void attachmentQueryDefaultFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
339 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
341 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
343 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
345 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
348 static void attachmentQueryEmptyFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
360 checkFboAttachmentParam(testCtx, ctx, attachmentPoints[ndx], GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
362 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 0);
367 checkError(testCtx, ctx, GL_INVALID_OPERATION);
369 checkError(testCtx, ctx, GL_INVALID_OPERATION);
372 static void attachmentQueryTex2DTest (tcu::TestContext& testCtx, sglr::Context& ctx)
379 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
380 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 1);
381 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, 0);
382 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, 0);
385 static void attachmentQueryTexCubeTest (tcu::TestContext& testCtx, sglr::Context& ctx)
392 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
393 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 2);
394 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, 0);
395 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y);
398 static void attachmentQueryRboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
405 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
406 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 3);
410 checkError(testCtx, ctx, GL_INVALID_ENUM);
412 checkError(testCtx, ctx, GL_INVALID_ENUM);
415 static void deleteTex2DAttachedToBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
423 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
424 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
428 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
431 static void deleteTexCubeAttachedToBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
439 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
440 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
444 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
447 static void deleteRboAttachedToBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
455 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
456 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
460 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
463 static void deleteTex2DAttachedToNotBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
471 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
472 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
480 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
481 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
484 static void deleteTexCubeAttachedToNotBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
492 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
493 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
501 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
502 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
505 static void deleteRboAttachedToNotBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
513 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
514 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
522 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
523 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
529 typedef void (*TestFunc) (tcu::TestContext& testCtx, sglr::Context& context);