Commit d39eca2b authored by Chad Versace's avatar Chad Versace

cmake: Prefix cmake options and feature macros with PIGLIT

Some cmake options and features macros had form USE_${feature}, others
BUILD_${category}_TESTS. This patch consistently prefixes all such options
and macros with PIGLIT.

Piglit, be a good code citizen. Namespace your variables.

This patch was created with
  find . -type f  | xargs sed -i \
    -e 's/\(^\|[^_]\)\(USE_\(GLX\|GLUT\|WAFFLE\|OPENGL\|OPENGL_ES1\|OPENGL_ES2\)\)\($\|[^_]\)/\1PIGLIT_\2\4/g' \
    -e 's/\(^\|[^_]\)\(BUILD_\(CL\|GLX\|GLES1\|GLES2\)_TESTS\)\($\|[^_]\)/\1PIGLIT_\2\4/g' \
Reviewed-and-tested-by: Jordan Justen's avatarJordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Tested-by: Paul Berry's avatarPaul Berry <stereotype441@gmail.com>
Acked-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent 074a6d54
......@@ -17,37 +17,37 @@ find_package(PNG REQUIRED)
find_package(X11)
option(BUILD_GLES1_TESTS "Build tests for OpenGL ES1" OFF)
option(BUILD_GLES2_TESTS "Build tests for OpenGL ES2" OFF)
option(BUILD_CL_TESTS "Build tests for OpenCL" OFF)
option(PIGLIT_BUILD_GLES1_TESTS "Build tests for OpenGL ES1" OFF)
option(PIGLIT_BUILD_GLES2_TESTS "Build tests for OpenGL ES2" OFF)
option(PIGLIT_BUILD_CL_TESTS "Build tests for OpenCL" OFF)
option(USE_WAFFLE "Use Waffle in place of GLUT" OFF)
if(USE_WAFFLE)
option(PIGLIT_USE_WAFFLE "Use Waffle in place of GLUT" OFF)
if(PIGLIT_USE_WAFFLE)
pkg_check_modules(WAFFLE REQUIRED waffle-1>=1.0.1)
add_definitions(-DUSE_WAFFLE)
add_definitions(-DPIGLIT_USE_WAFFLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WAFFLE_CFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WAFFLE_CFLAGS}")
endif(USE_WAFFLE)
endif(PIGLIT_USE_WAFFLE)
if(BUILD_GLES1_TESTS AND NOT USE_WAFFLE)
message(FATAL_ERROR "Option BUILD_GLES1_TESTS requires USE_WAFFLE")
endif(BUILD_GLES1_TESTS AND NOT USE_WAFFLE)
if(PIGLIT_BUILD_GLES1_TESTS AND NOT PIGLIT_USE_WAFFLE)
message(FATAL_ERROR "Option PIGLIT_BUILD_GLES1_TESTS requires PIGLIT_USE_WAFFLE")
endif(PIGLIT_BUILD_GLES1_TESTS AND NOT PIGLIT_USE_WAFFLE)
if(BUILD_GLES2_TESTS AND NOT USE_WAFFLE)
message(FATAL_ERROR "Option BUILD_GLES2_TESTS requires USE_WAFFLE")
endif(BUILD_GLES2_TESTS AND NOT USE_WAFFLE)
if(PIGLIT_BUILD_GLES2_TESTS AND NOT PIGLIT_USE_WAFFLE)
message(FATAL_ERROR "Option PIGLIT_BUILD_GLES2_TESTS requires PIGLIT_USE_WAFFLE")
endif(PIGLIT_BUILD_GLES2_TESTS AND NOT PIGLIT_USE_WAFFLE)
if(BUILD_CL_TESTS)
if(PIGLIT_BUILD_CL_TESTS)
find_package(OpenCL REQUIRED)
endif(BUILD_CL_TESTS)
endif(PIGLIT_BUILD_CL_TESTS)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_definitions(-DPIGLIT_HAS_X11)
option(BUILD_GLX_TESTS "Build tests that require GLX" ON)
option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" ON)
ELSE()
option(BUILD_GLX_TESTS "Build tests that require GLX" OFF)
option(PIGLIT_BUILD_GLX_TESTS "Build tests that require GLX" OFF)
ENDIF()
IF(BUILD_GLX_TESTS)
IF(PIGLIT_BUILD_GLX_TESTS)
pkg_check_modules(GLPROTO REQUIRED glproto)
ENDIF()
......
......@@ -25,14 +25,14 @@ add_subdirectory(no_api)
add_subdirectory(gl)
if(BUILD_GLES1_TESTS)
if(PIGLIT_BUILD_GLES1_TESTS)
add_subdirectory(gles1)
endif(BUILD_GLES1_TESTS)
endif(PIGLIT_BUILD_GLES1_TESTS)
if(BUILD_GLES2_TESTS)
if(PIGLIT_BUILD_GLES2_TESTS)
add_subdirectory(gles2)
endif(BUILD_GLES2_TESTS)
endif(PIGLIT_BUILD_GLES2_TESTS)
if(BUILD_CL_TESTS)
if(PIGLIT_BUILD_CL_TESTS)
add_subdirectory(cl)
endif(BUILD_CL_TESTS)
endif(PIGLIT_BUILD_CL_TESTS)
set(piglit_target_api "gl")
add_definitions(
-DUSE_OPENGL
-DPIGLIT_USE_OPENGL
)
if(USE_WAFFLE)
if(PIGLIT_USE_WAFFLE)
link_libraries(glut_waffle)
else(USE_WAFFLE)
add_definitions(-DUSE_GLUT)
else(PIGLIT_USE_WAFFLE)
add_definitions(-DPIGLIT_USE_GLUT)
include_directories(
${GLUT_INCLUDE_DIR}
)
link_libraries(
${GLUT_glut_LIBRARY}
)
endif(USE_WAFFLE)
endif(PIGLIT_USE_WAFFLE)
add_subdirectory(${piglit_SOURCE_DIR}/tests
${piglit_BINARY_DIR}/target_api/${piglit_target_api}/tests
......
set(piglit_target_api "gles1")
add_definitions(
-DUSE_OPENGL_ES1
-DPIGLIT_USE_OPENGL_ES1
)
link_libraries(glut_waffle)
add_subdirectory(${piglit_SOURCE_DIR}/tests
......
set(piglit_target_api "gles2")
add_definitions(
-DUSE_OPENGL_ES2
-DPIGLIT_USE_OPENGL_ES2
)
link_libraries(glut_waffle)
add_subdirectory(${piglit_SOURCE_DIR}/tests
......
if(USE_WAFFLE)
if(PIGLIT_USE_WAFFLE)
add_subdirectory(glut_waffle)
endif(USE_WAFFLE)
endif(PIGLIT_USE_WAFFLE)
......@@ -29,7 +29,7 @@
* \brief Convenience header that includes the actual OpenGL headers.
*
* The actual OpenGL headers are chosen according to the macro definitions
* USE_OPENGL, USE_OPENGL_ES1, and USE_OPENGL_ES2.
* PIGLIT_USE_OPENGL, PIGLIT_USE_OPENGL_ES1, and PIGLIT_USE_OPENGL_ES2.
*/
#pragma once
......@@ -42,10 +42,10 @@ extern "C" {
#include <windows.h>
#endif
#if defined(USE_OPENGL)
#if defined(PIGLIT_USE_OPENGL)
# include "piglit-dispatch.h"
#elif defined(USE_OPENGL_ES1)
#elif defined(PIGLIT_USE_OPENGL_ES1)
# include <GLES/gl.h>
# include <GLES/glext.h>
......@@ -57,7 +57,7 @@ extern "C" {
# define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
# define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES
#elif defined(USE_OPENGL_ES2)
#elif defined(PIGLIT_USE_OPENGL_ES2)
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
#endif
......
......@@ -29,7 +29,7 @@
* \brief Convenience header that includes the actual GLUT headers.
*
* The actual GLUT headers are chosen according to the macro definitions
* USE_GLUT and USE_WAFFLE.
* PIGLIT_USE_GLUT and PIGLIT_USE_WAFFLE.
*/
#pragma once
......@@ -42,9 +42,9 @@ extern "C" {
#include <windows.h>
#endif
#if defined(USE_WAFFLE)
#if defined(PIGLIT_USE_WAFFLE)
# include <glut_waffle/glut_waffle.h>
#elif defined(USE_GLUT)
#elif defined(PIGLIT_USE_GLUT)
# ifdef __APPLE__
# include <GLUT/glut.h>
......
......@@ -25,6 +25,6 @@ IF(OPENGL_egl_LIBRARY)
add_subdirectory (egl)
ENDIF(OPENGL_egl_LIBRARY)
IF(BUILD_CL_TESTS)
IF(PIGLIT_BUILD_CL_TESTS)
add_subdirectory (cl)
ENDIF(BUILD_CL_TESTS)
ENDIF(PIGLIT_BUILD_CL_TESTS)
......@@ -11,10 +11,10 @@ link_libraries (
${OPENGL_glu_LIBRARY}
)
if(NOT USE_WAFFLE)
if(NOT PIGLIT_USE_WAFFLE)
# This test uses glutSolidSphere.
piglit_add_executable (fbo-depth-sample-compare fbo-depth-sample-compare.c)
endif(NOT USE_WAFFLE)
endif(NOT PIGLIT_USE_WAFFLE)
piglit_add_executable (fbo-1d fbo-1d.c)
piglit_add_executable (fbo-alphatest-formats fbo-alphatest-formats.c)
......
......@@ -10,10 +10,10 @@ link_libraries (
${OPENGL_glu_LIBRARY}
)
if(NOT USE_WAFFLE)
if(NOT PIGLIT_USE_WAFFLE)
# This test uses glutCreateSubWindow.
piglit_add_executable (windowoverlap windowoverlap.c)
endif(NOT USE_WAFFLE)
endif(NOT PIGLIT_USE_WAFFLE)
piglit_add_executable (array-stride array-stride.c)
piglit_add_executable (bgra-vert-attrib-pointer bgra-vert-attrib-pointer.c)
......
......@@ -51,13 +51,13 @@ get_shader_compile_status(GLuint shader)
{
GLint status;
#if defined USE_OPENGL
#if defined PIGLIT_USE_OPENGL
if (gl_version_times_10 >= 20) {
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
} else {
glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status);
}
#elif defined USE_OPENGL_ES2
#elif defined PIGLIT_USE_OPENGL_ES2
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
#else
# error
......@@ -71,13 +71,13 @@ get_shader_info_log_length(GLuint shader)
{
GLsizei length;
#if defined USE_OPENGL
#if defined PIGLIT_USE_OPENGL
if (gl_version_times_10 >= 20) {
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
} else {
glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length);
}
#elif defined USE_OPENGL_ES2
#elif defined PIGLIT_USE_OPENGL_ES2
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
#else
# error
......
......@@ -4,18 +4,18 @@ include_directories(
${OPENGL_INCLUDE_PATH}
)
if(BUILD_GLX_TESTS)
if(PIGLIT_BUILD_GLX_TESTS)
link_libraries (
piglitglxutil
)
endif(BUILD_GLX_TESTS)
endif(PIGLIT_BUILD_GLX_TESTS)
link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
)
IF(BUILD_GLX_TESTS)
IF(PIGLIT_BUILD_GLX_TESTS)
include_directories(
${GLPROTO_INCLUDE_DIRS}
)
......@@ -66,6 +66,6 @@ IF(BUILD_GLX_TESTS)
piglit_add_executable (glx-copy-sub-buffer glx-copy-sub-buffer.c)
piglit_add_executable (glx-query-drawable glx-query-drawable.c)
ENDIF(BUILD_GLX_TESTS)
ENDIF(PIGLIT_BUILD_GLX_TESTS)
# vim: ft=cmake:
......@@ -4,18 +4,18 @@ include_directories(
${OPENGL_INCLUDE_PATH}
)
if(BUILD_GLX_TESTS)
if(PIGLIT_BUILD_GLX_TESTS)
link_libraries (
piglitglxutil
)
endif(BUILD_GLX_TESTS)
endif(PIGLIT_BUILD_GLX_TESTS)
link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
)
IF(BUILD_GLX_TESTS)
IF(PIGLIT_BUILD_GLX_TESTS)
include_directories(
${GLPROTO_INCLUDE_DIRS}
)
......@@ -40,6 +40,6 @@ IF(BUILD_GLX_TESTS)
piglit_add_executable (glx-create-context-valid-attribute-empty valid-attribute-empty.c common.c)
piglit_add_executable (glx-create-context-valid-attribute-null valid-attribute-null.c common.c)
piglit_add_executable (glx-create-context-valid-flag-forward-compatible valid-flag-forward-compatible.c common.c)
ENDIF(BUILD_GLX_TESTS)
ENDIF(PIGLIT_BUILD_GLX_TESTS)
# vim: ft=cmake:
......@@ -4,18 +4,18 @@ include_directories(
${OPENGL_INCLUDE_PATH}
)
if(BUILD_GLX_TESTS)
if(PIGLIT_BUILD_GLX_TESTS)
link_libraries (
piglitglxutil
)
endif(BUILD_GLX_TESTS)
endif(PIGLIT_BUILD_GLX_TESTS)
link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
)
IF(BUILD_GLX_TESTS)
IF(PIGLIT_BUILD_GLX_TESTS)
include_directories(
${GLPROTO_INCLUDE_DIRS}
)
......@@ -31,6 +31,6 @@ IF(BUILD_GLX_TESTS)
piglit_add_executable (glx-make-current-multi-process make-current-multi-process.c common.c)
piglit_add_executable (glx-make-current-single-process make-current-single-process.c common.c)
piglit_add_executable (glx-query-context-info-ext query-context-info.c common.c)
ENDIF(BUILD_GLX_TESTS)
ENDIF(PIGLIT_BUILD_GLX_TESTS)
# vim: ft=cmake:
......@@ -94,7 +94,7 @@ piglit_init(int argc, char **argv)
glTexImage2D(GL_TEXTURE_2D, 0, t[i].internal_format,
16, 16, 0,
t[i].internal_format, t[i].type, buffer);
#if defined(USE_OPENGL_ES1) || defined(USE_OPENGL_ES2)
#if defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
if (!piglit_check_gl_error(GL_INVALID_VALUE))
piglit_report_result(PIGLIT_FAIL);
#else
......@@ -170,7 +170,7 @@ piglit_init(int argc, char **argv)
glCompressedTexImage2D(GL_TEXTURE_2D, 0, t[i].internal_format,
16, 16, 1,
size + t[i].palette_size, buffer);
#if defined(USE_OPENGL_ES1) || defined(USE_OPENGL_ES2)
#if defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
if (!piglit_check_gl_error(GL_INVALID_VALUE))
piglit_report_result(PIGLIT_FAIL);
#else
......
......@@ -18,14 +18,14 @@ link_libraries(
${UTIL_GL_LIBS}
)
IF(BUILD_GLX_TESTS)
IF(PIGLIT_BUILD_GLX_TESTS)
# XXX: This is currently duplicated wherever tests
# include "piglit-glx-util.h". Is it possible to refactor it?
include_directories(
${GLPROTO_INCLUDE_DIRS}
)
add_definitions ( -DUSE_GLX )
add_definitions ( -DPIGLIT_USE_GLX )
piglit_add_library (piglitglxutil
piglit-shader.c
piglit-shader-gl.c
......@@ -44,7 +44,7 @@ IF(BUILD_GLX_TESTS)
${UTIL_GL_SOURCES}
piglit-glx-util.c
)
ENDIF(BUILD_GLX_TESTS)
ENDIF(PIGLIT_BUILD_GLX_TESTS)
piglit_add_library (piglitutil_${piglit_target_api}
${UTIL_GL_SOURCES}
......
......@@ -21,17 +21,17 @@
* IN THE SOFTWARE.
*/
#if defined(USE_OPENGL_ES1)
#if defined(PIGLIT_USE_OPENGL_ES1)
# define PIGLIT_FRAMEWORK_FBO_DISABLED
#elif defined(USE_WAFFLE)
#elif defined(PIGLIT_USE_WAFFLE)
# define PIGLIT_FRAMEWORK_FBO_USE_WAFFLE
#elif defined(USE_GLX)
#elif defined(PIGLIT_USE_GLX)
# define PIGLIT_FRAMEWORK_FBO_USE_GLX
#else
# define PIGLIT_FRAMEWORK_FBO_DISABLED
#endif
#ifdef USE_OPENGL_ES2
#ifdef PIGLIT_USE_OPENGL_ES2
# define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
# define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
#endif
......@@ -147,11 +147,11 @@ piglit_framework_fbo_waffle_init(void)
"value \"%s\"", env_platform);
}
#if defined(USE_OPENGL)
#if defined(PIGLIT_USE_OPENGL)
waffle_context_api = WAFFLE_CONTEXT_OPENGL;
#elif defined(USE_OPENGL_ES1)
#elif defined(PIGLIT_USE_OPENGL_ES1)
waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES1;
#elif defined(USE_OPENGL_ES2)
#elif defined(PIGLIT_USE_OPENGL_ES2)
waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES2;
#else
# error
......@@ -240,7 +240,7 @@ piglit_framework_fbo_gl_init(const struct piglit_gl_test_info *info)
GLuint tex, depth = 0;
GLenum status;
#ifdef USE_OPENGL
#ifdef PIGLIT_USE_OPENGL
glewInit();
if (piglit_get_gl_version() < 20)
......@@ -317,7 +317,7 @@ piglit_framework_fbo_init(const struct piglit_gl_test_info *info)
static void
piglit_framework_fbo_destroy(void)
{
#ifdef USE_OPENGL
#ifdef PIGLIT_USE_OPENGL
glDeleteFramebuffers(1, &piglit_winsys_fbo);
#endif
......
......@@ -31,7 +31,7 @@
#include "piglit-framework-gl.h"
#include "piglit-framework-glut.h"
#ifdef USE_GLX
#ifdef PIGLIT_USE_GLX
#include "piglit-glx-util.h"
#endif
......@@ -103,12 +103,12 @@ piglit_framework_glut_init(int argc, char *argv[],
test_info = info;
glutInit(&argc, argv);
# if defined(USE_WAFFLE)
# if defined(USE_OPENGL)
# if defined(PIGLIT_USE_WAFFLE)
# if defined(PIGLIT_USE_OPENGL)
glutInitAPIMask(GLUT_OPENGL_BIT);
# elif defined(USE_OPENGL_ES1)
# elif defined(PIGLIT_USE_OPENGL_ES1)
glutInitAPIMask(GLUT_OPENGL_ES1_BIT);
# elif defined(USE_OPENGL_ES2)
# elif defined(PIGLIT_USE_OPENGL_ES2)
glutInitAPIMask(GLUT_OPENGL_ES2_BIT);
# else
# error
......@@ -121,7 +121,7 @@ piglit_framework_glut_init(int argc, char *argv[],
glutInitDisplayMode(info->window_visual);
piglit_window = glutCreateWindow(argv[0]);
#if defined(USE_GLX) && !defined(USE_WAFFLE)
#if defined(PIGLIT_USE_GLX) && !defined(PIGLIT_USE_WAFFLE)
/* If using waffle, then the current platform might not be GLX.
* So we can't call any GLX functions.
*
......@@ -136,7 +136,7 @@ piglit_framework_glut_init(int argc, char *argv[],
glutReshapeFunc(reshape);
glutKeyboardFunc(piglit_escape_exit_key);
#ifdef USE_OPENGL
#ifdef PIGLIT_USE_OPENGL
glewInit();
#endif
}
......
......@@ -21,8 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef USE_OPENGL
# error USE_OPENGL is undefined
#ifndef PIGLIT_USE_OPENGL
# error PIGLIT_USE_OPENGL is undefined
#endif
#if defined(_MSC_VER)
......
......@@ -21,8 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef USE_OPENGL_ES1
# error USE_OPENGL_ES1 is undefined
#ifndef PIGLIT_USE_OPENGL_ES1
# error PIGLIT_USE_OPENGL_ES1 is undefined
#endif
#include "piglit-util-gl-common.h"
......
......@@ -21,8 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef USE_OPENGL_ES2
# error USE_OPENGL_ES2 is undefined
#ifndef PIGLIT_USE_OPENGL_ES2
# error PIGLIT_USE_OPENGL_ES2 is undefined
#endif
#include "piglit-util-gl-common.h"
......
......@@ -118,7 +118,7 @@ shader_name(GLenum target)
switch (target) {
case GL_VERTEX_SHADER:
return "vertex";
#if defined USE_OPENGL
#if defined PIGLIT_USE_OPENGL
case GL_GEOMETRY_SHADER:
return "geometry";
#endif
......
......@@ -45,7 +45,7 @@ GLint piglit_link_simple_program(GLint vs, GLint fs);
* wrappers.
*/
/*@{*/
#if defined(USE_OPENGL_ES1)
#if defined(PIGLIT_USE_OPENGL_ES1)
#define piglit_AttachShader assert(!"glAttachShader does not exist in ES1")
#define piglit_BindAttribLocation assert(!"glBindAttribLocation does not exist in ES1")
#define piglit_CompileShader assert(!"glCompileShader does not exist in ES1")
......@@ -88,7 +88,7 @@ GLint piglit_link_simple_program(GLint vs, GLint fs);
#define piglit_UniformMatrix3x4fv assert(!"glUniformMatrix3x4fv does not exist in ES1")
#define piglit_UniformMatrix4x2fv assert(!"glUniformMatrix4x2fv does not exist in ES1")
#define piglit_UniformMatrix4x3fv assert(!"glUniformMatrix4x3fv does not exist in ES1")
#elif defined(USE_OPENGL_ES2)
#elif defined(PIGLIT_USE_OPENGL_ES2)
#define piglit_AttachShader glAttachShader
#define piglit_BindAttribLocation glBindAttribLocation
#define piglit_CompileShader glCompileShader
......
......@@ -90,7 +90,7 @@ static const char** gl_extension_array_from_getstring()
return split_string(gl_extensions_string);
}
#if defined(USE_OPENGL)
#if defined(PIGLIT_USE_OPENGL)
static const char** gl_extension_array_from_getstringi()
{
const char **strings;
......@@ -116,9 +116,9 @@ static void initialize_piglit_extension_support(void)
return;
}
#if defined(USE_OPENGL_ES1) || defined(USE_OPENGL_ES2)
#if defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
gl_extensions = gl_extension_array_from_getstring();
#elif defined(USE_OPENGL)
#elif defined(PIGLIT_USE_OPENGL)
if (piglit_get_gl_version() < 30) {
gl_extensions = gl_extension_array_from_getstring();
} else {
......
......@@ -30,10 +30,10 @@
#endif
/* Force GL defines */
#ifndef USE_OPENGL
# define USE_OPENGL
# undef USE_OPENGL_ES1
# undef USE_OPENGL_ES2
#ifndef PIGLIT_USE_OPENGL
# define PIGLIT_USE_OPENGL
# undef PIGLIT_USE_OPENGL_ES1
# undef PIGLIT_USE_OPENGL_ES2
#endif
#include "piglit-util-gl-common.h"
......
......@@ -188,7 +188,7 @@ piglit_escape_exit_key(unsigned char key, int x, int y)
static void
draw_arrays(const GLvoid *verts, const GLvoid *tex)
{
#if defined(USE_OPENGL_ES1)
#if defined(PIGLIT_USE_OPENGL_ES1)
if (verts) {
glVertexPointer(4, GL_FLOAT, 0, verts);
glEnableClientState(GL_VERTEX_ARRAY);
......@@ -205,7 +205,7 @@ draw_arrays(const GLvoid *verts, const GLvoid *tex)
glDisableClientState(GL_VERTEX_ARRAY);
if (tex)
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
#elif defined(USE_OPENGL_ES2)
#elif defined(PIGLIT_USE_OPENGL_ES2)
if (verts) {
glVertexAttribPointer(PIGLIT_ATTRIB_POS, 4, GL_FLOAT, GL_FALSE, 0, verts);
glEnableVertexAttribArray(PIGLIT_ATTRIB_POS);
......@@ -521,7 +521,7 @@ piglit_checkerboard_texture(GLuint tex, unsigned level,
return tex;
}
#if defined(USE_OPENGL_ES1)
#if defined(PIGLIT_USE_OPENGL_ES1)
/**
* Convenience function to configure an abitrary orthogonal projection matrix
......@@ -556,4 +556,4 @@ piglit_ortho_projection(int w, int h, GLboolean push)
piglit_gen_ortho_projection(0, w, 0, h, -1, 1, push);
}
#endif /* USE_OPENGL_ES1 */
#endif /* PIGLIT_USE_OPENGL_ES1 */
......@@ -631,7 +631,7 @@ piglit_ktx_load_noncubeface(struct piglit_ktx *self,
switch (info->target) {
case GL_TEXTURE_1D:
#ifdef USE_OPENGL
#ifdef PIGLIT_USE_OPENGL
if (info->gl_type == 0)
glCompressedTexImage1D(info->target,
level,
......@@ -679,7 +679,7 @@ piglit_ktx_load_noncubeface(struct piglit_ktx *self,
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
case GL_TEXTURE_CUBE_MAP_ARRAY:
#ifdef USE_OPENGL
#ifdef PIGLIT_USE_OPENGL
if (info->gl_type == 0)
glCompressedTexImage3D(info->target,
level,
......@@ -715,7 +715,7 @@ piglit_ktx_load_noncubeface(struct piglit_ktx *self,
*gl_error = glGetError();
return *gl_error == 0;
#ifndef USE_OPENGL
#ifndef PIGLIT_USE_OPENGL
unsupported_on_gles:
*gl_error = 0;
piglit_ktx_error("%s", "GLES supports only GL_TEXTURE_2D and "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment