void piglit_test_min_viewport_dimensions(void) { int min_w, min_h; GLint dims[2] = {9999, 9999}; if (piglit_get_gl_version() < 30) { /* FINISHME: * * "The maximum viewport dimensions must be * greater than or equal to the larger of the * visible dimensions of the display being * rendered to (if a display exists), and the * largest renderbuffer image which can be * successfully created and attached to a * framebuffer object (see chapter 4). INVALID * VALUE is generated if either w or h is * negative." * * We're only looking at RB limits here. */ int rb_size = 9999; glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &rb_size); min_w = rb_size; min_h = rb_size; } else { /* FINISHME: * * "The maximum viewport dimensions must be * greater than or equal to the visible * dimensions of the display being rendered to." * * Surely the screen is at least 1024x768, right? */ min_w = 1024; min_h = 768; } glGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims); piglit_report_int("GL_MAX_VIEWPORT_DIMS[0]", min_w, dims[0], dims[0] >= min_w); piglit_report_int("GL_MAX_VIEWPORT_DIMS[1]", min_h, dims[1], dims[1] >= min_h); }
static void piglit_test_int(GLenum token, GLint limit, bool max) { const char *name = piglit_get_gl_enum_name(token); GLint val = 9999; glGetIntegerv(token, &val); piglit_report_int(name, limit, val, (max && val <= limit) || (!max && val >= limit)); }
static void piglit_test_int_v(GLenum token, GLuint index, GLint limit, bool max) { char *name; GLint val = 9999; (void)!asprintf(&name, "%s[%d]", piglit_get_gl_enum_name(token), index); glGetIntegeri_v(token, index, &val); piglit_report_int(name, limit, val, (max && val <= limit) || (!max && val >= limit)); }
static void piglit_test_int(GLenum token, GLint limit, bool max) { const char *name = piglit_get_gl_enum_name(token); GLint val = SENTINEL; bool pass; glGetIntegerv(token, &val); pass = piglit_check_gl_error(GL_NO_ERROR); piglit_report_int(name, limit, val, pass && val != (GLint)SENTINEL && ((max && val <= limit) || (!max && val >= limit))); }