Lines Matching refs:testCtx

59 static void logComment (tcu::TestContext& testCtx, const char* comment)
61 testCtx.getLog() << TestLog::Message << "// " << comment << TestLog::EndMessage;
64 static void checkError (tcu::TestContext& testCtx, sglr::Context& ctx, GLenum expect)
67 testCtx.getLog() << TestLog::Message << "// " << (result == expect ? "Pass" : "Fail") << ", expected " << glu::getErrorStr(expect) << TestLog::EndMessage;
70 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error code mismatch");
73 static void checkEitherError (tcu::TestContext& testCtx, sglr::Context& ctx, GLenum expectA, GLenum expectB)
78 testCtx.getLog() << TestLog::Message << "// " << (isOk ? "Pass" : "Fail") << ", expected " << glu::getErrorStr(expectA) << " or " << glu::getErrorStr(expectB) << TestLog::EndMessage;
81 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Error code mismatch");
129 static void checkFboAttachmentParam (tcu::TestContext& testCtx, sglr::Context& ctx, GLenum attachment, GLenum pname, GLint expectedValue)
131 TestLog& log = testCtx.getLog();
144 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid result for attachment param query");
148 static void notSupportedTest (tcu::TestContext& testCtx, sglr::Context& context)
150 DE_UNREF(testCtx);
155 static void textureLevelsTest (tcu::TestContext& testCtx, sglr::Context& context)
171 checkError(testCtx, context, levels[ndx] == 0 ? GL_NO_ERROR : GL_INVALID_VALUE);
175 static void textureLevelsWithRenderToMipmapTest (tcu::TestContext& testCtx, sglr::Context& context)
191 checkError(testCtx, context, de::inBounds(levels[ndx], 0, 16) ? GL_NO_ERROR : GL_INVALID_VALUE);
195 static void validTex2DAttachmentsTest (tcu::TestContext& testCtx, sglr::Context& context)
211 checkError(testCtx, context, GL_NO_ERROR);
215 static void validTexCubeAttachmentsTest (tcu::TestContext& testCtx, sglr::Context& context)
243 checkError(testCtx, context, GL_NO_ERROR);
248 static void validRboAttachmentsTest (tcu::TestContext& testCtx, sglr::Context& context)
265 checkError(testCtx, context, GL_NO_ERROR);
269 static void attachToDefaultFramebufferTest (tcu::TestContext& testCtx, sglr::Context& context)
271 logComment(testCtx, "Attaching 2D texture to default framebuffer");
276 checkError(testCtx, context, GL_INVALID_OPERATION);
278 logComment(testCtx, "Attaching renderbuffer to default framebuffer");
283 checkError(testCtx, context, GL_INVALID_OPERATION);
286 static void invalidTex2DAttachmentTest (tcu::TestContext& testCtx, sglr::Context& context)
290 logComment(testCtx, "Attaching 2D texture using GL_TEXTURE_CUBE_MAP_NEGATIVE_X texture target");
295 checkError(testCtx, context, GL_INVALID_OPERATION);
297 logComment(testCtx, "Attaching deleted 2D texture object");
300 checkError(testCtx, context, GL_INVALID_OPERATION);
303 static void invalidTexCubeAttachmentTest (tcu::TestContext& testCtx, sglr::Context& context)
307 logComment(testCtx, "Attaching cube texture using GL_TEXTURE_2D texture target");
311 checkError(testCtx, context, GL_INVALID_OPERATION);
313 logComment(testCtx, "Attaching deleted cube texture object");
316 checkError(testCtx, context, GL_INVALID_OPERATION);
319 static void invalidRboAttachmentTest (tcu::TestContext& testCtx, sglr::Context& context)
323 logComment(testCtx, "Attaching renderbuffer using GL_FRAMEBUFFER renderbuffer target");
327 checkError(testCtx, context, GL_INVALID_ENUM);
329 logComment(testCtx, "Attaching deleted renderbuffer object");
332 checkError(testCtx, context, GL_INVALID_OPERATION);
335 static void attachNamesTest (tcu::TestContext& testCtx, sglr::Context& context)
343 logComment(testCtx, "Attaching allocated texture name to 2D target");
345 checkError(testCtx, context, GL_INVALID_OPERATION);
347 logComment(testCtx, "Attaching allocated texture name to cube target");
349 checkError(testCtx, context, GL_INVALID_OPERATION);
354 logComment(testCtx, "Attaching allocated renderbuffer name");
356 checkError(testCtx, context, GL_INVALID_OPERATION);
359 static void attachmentQueryDefaultFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
364 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
366 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
368 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
370 checkEitherError(testCtx, ctx, GL_INVALID_ENUM, GL_INVALID_OPERATION);
373 static void attachmentQueryEmptyFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
385 checkFboAttachmentParam(testCtx, ctx, attachmentPoints[ndx], GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
390 checkError(testCtx, ctx, GL_INVALID_ENUM);
392 checkError(testCtx, ctx, GL_INVALID_ENUM);
394 checkError(testCtx, ctx, GL_INVALID_ENUM);
397 static void es3AttachmentQueryEmptyFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
412 checkFboAttachmentParam(testCtx, ctx, attachmentPoints[ndx], GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
414 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 0);
419 checkError(testCtx, ctx, GL_INVALID_OPERATION);
421 checkError(testCtx, ctx, GL_INVALID_OPERATION);
424 static void attachmentQueryTex2DTest (tcu::TestContext& testCtx, sglr::Context& ctx)
431 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
432 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 1);
433 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, 0);
434 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, 0);
437 static void attachmentQueryTexCubeTest (tcu::TestContext& testCtx, sglr::Context& ctx)
444 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
445 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 2);
446 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, 0);
447 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y);
450 static void attachmentQueryRboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
457 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
458 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, 3);
462 checkError(testCtx, ctx, GL_INVALID_ENUM);
464 checkError(testCtx, ctx, GL_INVALID_ENUM);
467 static void deleteTex2DAttachedToBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
475 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
476 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_NONE);
483 static void deleteTexCubeAttachedToBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
491 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
492 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
496 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
499 static void deleteRboAttachedToBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
507 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
508 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
512 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_NONE);
515 static void deleteTex2DAttachedToNotBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
523 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
524 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
532 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
533 checkFboAttachmentParam(testCtx, ctx, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, tex2D);
536 static void deleteTexCubeAttachedToNotBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
544 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
545 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
553 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_TEXTURE);
554 checkFboAttachmentParam(testCtx, ctx, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, texCube);
557 static void deleteRboAttachedToNotBoundFboTest (tcu::TestContext& testCtx, sglr::Context& ctx)
565 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
566 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
574 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_RENDERBUFFER);
575 checkFboAttachmentParam(testCtx, ctx, GL_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, rbo);
581 typedef void (*TestFunc) (tcu::TestContext& testCtx, sglr::Context& context);