JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglVertexAttribP4ui(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jint value, jlong __functionAddress) {
	glVertexAttribP4uiPROC glVertexAttribP4ui = (glVertexAttribP4uiPROC)(intptr_t)__functionAddress;
	UNUSED_PARAMS(__env, clazz)
	glVertexAttribP4ui(index, type, normalized, value);
}
Ejemplo n.º 2
0
static bool
test_vertex_attribs()
{
	bool pass = true;
	GLuint data = 0;

	/* "The error INVALID_OPERATION is generated by ... , or VertexAttribPointer
	 * if <type> is UNSIGNED_INT_10F_11F_11F_REV and <size> is not 3.
	 */

	glVertexAttribPointer(0, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0, (GLvoid *)0);
	TEST("VertexAttribPointer-ok", GL_NO_ERROR);

	glVertexAttribPointer(0, 2, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0, (GLvoid *)0);
	TEST("VertexAttribPointer-badsize", GL_INVALID_OPERATION);

	glVertexAttribPointer(0, GL_BGRA, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0, (GLvoid *)0);
	TEST("VertexAttribPointer-badsize-bgra", GL_INVALID_OPERATION);

	/* The error INVALID_ENUM is generated by .., VertexAttribIPointer,
	 * VertexAttribLPointer, ... if <type> is UNSIGNED_INT_10F_11F_11F_REV.
	 */

	if (piglit_get_gl_version() >= 30) {
		glVertexAttribIPointer(0, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, 0, (GLvoid *)0);
		TEST("VertexAttribIPointer-not-allowed", GL_INVALID_ENUM);
	}

	if (piglit_is_extension_supported("GL_ARB_vertex_attrib_64bit")) {
		glVertexAttribLPointer(0, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, 0, (GLvoid *)0);
		TEST("VertexAttribLPointer-not-allowed", GL_INVALID_ENUM);
	}

	/* The error INVALID_ENUM is generated by ... VertexAttribP4ui, VertexAttribP4uiv
	 * if <type> is UNSIGNED_INT_10F_11F_11F_REV
	 */

	glVertexAttribP4ui(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0);
	TEST("VertexAttribP4ui-not-allowed", GL_INVALID_ENUM);

	glVertexAttribP4uiv(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, &data);
	TEST("VertexAttribP4uiv-not-allowed", GL_INVALID_ENUM);

	glVertexAttribP1ui(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0);
	TEST("VertexAttribP1ui-ok", GL_NO_ERROR);

	glVertexAttribP1uiv(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, &data);
	TEST("VertexAttribP1uiv-ok", GL_NO_ERROR);

	glVertexAttribP2ui(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0);
	TEST("VertexAttribP2ui-ok", GL_NO_ERROR);

	glVertexAttribP2uiv(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, &data);
	TEST("VertexAttribP2uiv-ok", GL_NO_ERROR);

	glVertexAttribP3ui(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 0);
	TEST("VertexAttribP3ui-ok", GL_NO_ERROR);

	glVertexAttribP3uiv(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, &data);
	TEST("VertexAttribP3uiv-ok", GL_NO_ERROR);

	/* Test that normalized = GL_TRUE doesn't spuriously produce an error */
	glVertexAttribP3uiv(0, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_TRUE, &data);
	TEST("VertexAttribP3uiv-normalized-ok", GL_NO_ERROR);

	return pass;
}