diff options
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r-- | mesalib/src/mesa/main/arrayobj.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/arrayobj.h | 26 | ||||
-rw-r--r-- | mesalib/src/mesa/main/attrib.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/compiler.h | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/context.c | 27 | ||||
-rw-r--r-- | mesalib/src/mesa/main/debug.c | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/dlopen.h | 19 | ||||
-rw-r--r-- | mesalib/src/mesa/main/errors.c | 8 | ||||
-rw-r--r-- | mesalib/src/mesa/main/extensions.c | 11 | ||||
-rw-r--r-- | mesalib/src/mesa/main/fbobject.c | 60 | ||||
-rw-r--r-- | mesalib/src/mesa/main/get_hash_params.py | 8 | ||||
-rw-r--r-- | mesalib/src/mesa/main/imports.c | 80 | ||||
-rwxr-xr-x | mesalib/src/mesa/main/imports.h | 45 | ||||
-rwxr-xr-x | mesalib/src/mesa/main/macros.h | 7 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mtypes.h | 20 | ||||
-rw-r--r-- | mesalib/src/mesa/main/shaderapi.c | 10 | ||||
-rw-r--r-- | mesalib/src/mesa/main/shaderobj.h | 7 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texcompress_s3tc.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/varray.c | 8 | ||||
-rw-r--r-- | mesalib/src/mesa/main/version.c | 16 | ||||
-rw-r--r-- | mesalib/src/mesa/main/viewport.c | 6 |
21 files changed, 133 insertions, 239 deletions
diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c index 0d77b112b..6440ea670 100644 --- a/mesalib/src/mesa/main/arrayobj.c +++ b/mesalib/src/mesa/main/arrayobj.c @@ -230,7 +230,7 @@ _mesa_initialize_vao(struct gl_context *ctx, obj->RefCount = 1; /* Init the individual arrays */ - for (i = 0; i < Elements(obj->_VertexAttrib); i++) { + for (i = 0; i < Elements(obj->VertexAttrib); i++) { switch (i) { case VERT_ATTRIB_WEIGHT: init_array(ctx, obj, VERT_ATTRIB_WEIGHT, 1, GL_FLOAT); diff --git a/mesalib/src/mesa/main/arrayobj.h b/mesalib/src/mesa/main/arrayobj.h index 1819cd12a..3c1f91835 100644 --- a/mesalib/src/mesa/main/arrayobj.h +++ b/mesalib/src/mesa/main/arrayobj.h @@ -78,32 +78,6 @@ extern void _mesa_update_vao_client_arrays(struct gl_context *ctx, struct gl_vertex_array_object *vao); - -/** Returns the bitmask of all enabled arrays in fixed function mode. - * - * In fixed function mode only the traditional fixed function arrays - * are available. - */ -static inline GLbitfield64 -_mesa_array_object_get_enabled_ff(const struct gl_vertex_array_object *vao) -{ - return vao->_Enabled & VERT_BIT_FF_ALL; -} - -/** Returns the bitmask of all enabled arrays in arb/glsl shader mode. - * - * In arb/glsl shader mode all the fixed function and the arb/glsl generic - * arrays are available. Only the first generic array takes - * precedence over the legacy position array. - */ -static inline GLbitfield64 -_mesa_array_object_get_enabled_arb(const struct gl_vertex_array_object *vao) -{ - GLbitfield64 enabled = vao->_Enabled; - return enabled & ~(VERT_BIT_POS & (enabled >> VERT_ATTRIB_GENERIC0)); -} - - /* * API functions */ diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index ef98ba7fd..d90e6627f 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -1449,7 +1449,7 @@ copy_array_object(struct gl_context *ctx, /* In theory must be the same anyway, but on recreate make sure it matches */ dest->ARBsemantics = src->ARBsemantics; - for (i = 0; i < Elements(src->_VertexAttrib); i++) { + for (i = 0; i < Elements(src->VertexAttrib); i++) { _mesa_copy_client_array(ctx, &dest->_VertexAttrib[i], &src->_VertexAttrib[i]); _mesa_copy_vertex_attrib_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]); _mesa_copy_vertex_buffer_binding(ctx, &dest->VertexBinding[i], &src->VertexBinding[i]); diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h index 813bf1905..34671dc7e 100644 --- a/mesalib/src/mesa/main/compiler.h +++ b/mesalib/src/mesa/main/compiler.h @@ -150,7 +150,7 @@ extern "C" { #elif defined(__APPLE__) #include <CoreFoundation/CFByteOrder.h> #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) -#elif (defined(_AIX) || defined(__blrts)) +#elif (defined(_AIX)) static inline GLuint CPU_TO_LE32(GLuint x) { return (((x & 0x000000ff) << 24) | @@ -214,13 +214,11 @@ static inline GLuint CPU_TO_LE32(GLuint x) /** * ASSERT macro */ -#if !defined(_WIN32_WCE) #if defined(DEBUG) # define ASSERT(X) assert(X) #else # define ASSERT(X) #endif -#endif /* diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 682b9c797..0edd66d6f 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -642,16 +642,14 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api) consts->MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS; /* Shading language version */ - if (api == API_OPENGL_COMPAT || api == API_OPENGL_CORE) { - consts->GLSLVersion = 120; - _mesa_override_glsl_version(consts); - } - else if (api == API_OPENGLES2) { - consts->GLSLVersion = 100; - } - else if (api == API_OPENGLES) { - consts->GLSLVersion = 0; /* GLSL not supported */ - } + consts->GLSLVersion = 120; + _mesa_override_glsl_version(consts); + +#ifdef DEBUG + consts->GenerateTemporaryNames = true; +#else + consts->GenerateTemporaryNames = false; +#endif /* GL_ARB_framebuffer_object */ consts->MaxSamples = 0; @@ -690,9 +688,6 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api) /* GL_ARB_robustness */ consts->ResetStrategy = GL_NO_RESET_NOTIFICATION_ARB; - /* PrimitiveRestart */ - consts->PrimitiveRestartInSoftware = GL_FALSE; - /* ES 3.0 or ARB_ES3_compatibility */ consts->MaxElementIndex = 0xffffffffu; @@ -1098,10 +1093,10 @@ _mesa_initialize_context(struct gl_context *ctx, ctx->CurrentDispatch = ctx->OutsideBeginEnd; ctx->FragmentProgram._MaintainTexEnvProgram - = (_mesa_getenv("MESA_TEX_PROG") != NULL); + = (getenv("MESA_TEX_PROG") != NULL); ctx->VertexProgram._MaintainTnlProgram - = (_mesa_getenv("MESA_TNL_PROG") != NULL); + = (getenv("MESA_TNL_PROG") != NULL); if (ctx->VertexProgram._MaintainTnlProgram) { /* this is required... */ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; @@ -1545,7 +1540,7 @@ handle_first_current(struct gl_context *ctx) * first time each context is made current we'll print some useful * information. */ - if (_mesa_getenv("MESA_INFO")) { + if (getenv("MESA_INFO")) { _mesa_print_info(ctx); } } diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c index a5b40b4b5..089ce8987 100644 --- a/mesalib/src/mesa/main/debug.c +++ b/mesalib/src/mesa/main/debug.c @@ -215,8 +215,8 @@ set_debug_flags(const char *str) void _mesa_init_debug( struct gl_context *ctx ) { - set_debug_flags(_mesa_getenv("MESA_DEBUG")); - set_verbose_flags(_mesa_getenv("MESA_VERBOSE")); + set_debug_flags(getenv("MESA_DEBUG")); + set_verbose_flags(getenv("MESA_VERBOSE")); } diff --git a/mesalib/src/mesa/main/dlopen.h b/mesalib/src/mesa/main/dlopen.h index b060cdbac..93d1258cf 100644 --- a/mesalib/src/mesa/main/dlopen.h +++ b/mesalib/src/mesa/main/dlopen.h @@ -47,9 +47,7 @@ typedef void (*GenericFunc)(void); static inline void * _mesa_dlopen(const char *libname, int flags) { -#if defined(__blrts) - return NULL; -#elif defined(HAVE_DLOPEN) +#if defined(HAVE_DLOPEN) flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */ return dlopen(libname, flags); #elif defined(__MINGW32__) || defined(_WIN32) @@ -71,16 +69,7 @@ _mesa_dlsym(void *handle, const char *fname) void *v; GenericFunc f; } u; -#if defined(__blrts) - u.v = NULL; -#elif defined(__DJGPP__) - /* need '_' prefix on symbol names */ - char fname2[1000]; - fname2[0] = '_'; - strncpy(fname2 + 1, fname, 998); - fname2[999] = 0; - u.v = dlsym(handle, fname2); -#elif defined(HAVE_DLOPEN) +#if defined(HAVE_DLOPEN) u.v = dlsym(handle, fname); #elif defined(__MINGW32__) || defined(_WIN32) u.v = (void *) GetProcAddress(handle, fname); @@ -96,9 +85,7 @@ _mesa_dlsym(void *handle, const char *fname) static inline void _mesa_dlclose(void *handle) { -#if defined(__blrts) - (void) handle; -#elif defined(HAVE_DLOPEN) +#if defined(HAVE_DLOPEN) dlclose(handle); #elif defined(__MINGW32__) || defined(_WIN32) FreeLibrary(handle); diff --git a/mesalib/src/mesa/main/errors.c b/mesalib/src/mesa/main/errors.c index 9cde1e020..25171f0ee 100644 --- a/mesalib/src/mesa/main/errors.c +++ b/mesalib/src/mesa/main/errors.c @@ -1170,7 +1170,7 @@ output_if_debug(const char *prefixString, const char *outputString, /* If MESA_LOG_FILE env var is set, log Mesa errors, warnings, * etc to the named file. Otherwise, output to stderr. */ - const char *logFile = _mesa_getenv("MESA_LOG_FILE"); + const char *logFile = getenv("MESA_LOG_FILE"); if (logFile) fout = fopen(logFile, "w"); if (!fout) @@ -1183,7 +1183,7 @@ output_if_debug(const char *prefixString, const char *outputString, debug = 1; #else /* in release builds, be silent unless MESA_DEBUG is set */ - debug = _mesa_getenv("MESA_DEBUG") != NULL; + debug = getenv("MESA_DEBUG") != NULL; #endif } @@ -1194,7 +1194,7 @@ output_if_debug(const char *prefixString, const char *outputString, fprintf(fout, "\n"); fflush(fout); -#if defined(_WIN32) && !defined(_WIN32_WCE) +#if defined(_WIN32) /* stderr from windows applications without console is not usually * visible, so communicate with the debugger instead */ { @@ -1288,7 +1288,7 @@ should_output(struct gl_context *ctx, GLenum error, const char *fmtString) /* Check debug environment variable only once: */ if (debug == -1) { - const char *debugEnv = _mesa_getenv("MESA_DEBUG"); + const char *debugEnv = getenv("MESA_DEBUG"); #ifdef DEBUG if (debugEnv && strstr(debugEnv, "silent")) diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 553c01e34..f0e2f89e4 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -588,7 +588,7 @@ free_unknown_extensions_strings(void) void _mesa_one_time_init_extension_overrides(void) { - const char *env_const = _mesa_getenv("MESA_EXTENSION_OVERRIDE"); + const char *env_const = getenv("MESA_EXTENSION_OVERRIDE"); char *env; char *ext; int len; @@ -609,6 +609,15 @@ _mesa_one_time_init_extension_overrides(void) /* Copy env_const because strtok() is destructive. */ env = strdup(env_const); + + if (env == NULL || extra_extensions == NULL || + cant_disable_extensions == NULL) { + free(env); + free(extra_extensions); + free(cant_disable_extensions); + return; + } + for (ext = strtok(env, " "); ext != NULL; ext = strtok(NULL, " ")) { int enable; bool recognized; diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index ae3a418cd..8283373a4 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -2303,8 +2303,8 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb, /** - * Common code called by glFramebufferTexture1D/2D/3DEXT() and - * glFramebufferTextureLayerEXT(). + * Common code called by glFramebufferTexture1D/2D/3D() and + * glFramebufferTextureLayer(). * * \param textarget is the textarget that was passed to the * glFramebufferTexture...() function, or 0 if the corresponding function @@ -2326,14 +2326,14 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, fb = get_framebuffer_target(ctx, target); if (!fb) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(target=0x%x)", caller, target); + "glFramebufferTexture%s(target=0x%x)", caller, target); return; } /* check framebuffer binding */ if (_mesa_is_winsys_fbo(fb)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT", caller); + "glFramebufferTexture%s", caller); return; } @@ -2397,14 +2397,14 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, else { /* can't render to a non-existant texture */ _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT(non existant texture)", + "glFramebufferTexture%s(non existant texture)", caller); return; } if (err) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT(texture target mismatch)", + "glFramebufferTexture%s(texture target mismatch)", caller); return; } @@ -2413,7 +2413,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); if (zoffset < 0 || zoffset >= maxSize) { _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(zoffset)", caller); + "glFramebufferTexture%s(zoffset)", caller); return; } } @@ -2424,7 +2424,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, if (zoffset < 0 || zoffset >= (GLint) ctx->Const.MaxArrayTextureLayers) { _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(layer)", caller); + "glFramebufferTexture%s(layer)", caller); return; } } @@ -2433,7 +2433,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, if ((level < 0) || (level >= _mesa_max_texture_levels(ctx, maxLevelsTarget))) { _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(level)", caller); + "glFramebufferTexture%s(level)", caller); return; } } @@ -2441,7 +2441,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, att = get_attachment(ctx, fb, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(attachment)", caller); + "glFramebufferTexture%s(attachment)", caller); return; } @@ -2531,7 +2531,7 @@ _mesa_FramebufferTexture1D(GLenum target, GLenum attachment, if (error) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture1DEXT(textarget=%s)", + "glFramebufferTexture1D(textarget=%s)", _mesa_lookup_enum_by_nr(textarget)); return; } @@ -2582,7 +2582,7 @@ _mesa_FramebufferTexture2D(GLenum target, GLenum attachment, if (error) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture2DEXT(textarget=%s)", + "glFramebufferTexture2D(textarget=%s)", _mesa_lookup_enum_by_nr(textarget)); return; } @@ -2602,7 +2602,7 @@ _mesa_FramebufferTexture3D(GLenum target, GLenum attachment, if ((texture != 0) && (textarget != GL_TEXTURE_3D)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture3DEXT(textarget)"); + "glFramebufferTexture3D(textarget)"); return; } @@ -2629,7 +2629,7 @@ _mesa_FramebufferTexture(GLenum target, GLenum attachment, GET_CURRENT_CONTEXT(ctx); if (_mesa_has_geometry_shaders(ctx)) { - framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, + framebuffer_texture(ctx, "", target, attachment, 0, texture, level, 0, GL_TRUE); } else { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -2651,26 +2651,26 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment, fb = get_framebuffer_target(ctx, target); if (!fb) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(target)"); + "glFramebufferRenderbuffer(target)"); return; } if (renderbufferTarget != GL_RENDERBUFFER_EXT) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(renderbufferTarget)"); + "glFramebufferRenderbuffer(renderbufferTarget)"); return; } if (_mesa_is_winsys_fbo(fb)) { /* Can't attach new renderbuffers to a window system framebuffer */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbuffer"); return; } att = get_attachment(ctx, fb, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(invalid attachment %s)", + "glFramebufferRenderbuffer(invalid attachment %s)", _mesa_lookup_enum_by_nr(attachment)); return; } @@ -2679,13 +2679,13 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment, rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); if (!rb) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(non-existant" + "glFramebufferRenderbuffer(non-existant" " renderbuffer %u)", renderbuffer); return; } else if (rb == &DummyRenderbuffer) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(renderbuffer %u)", + "glFramebufferRenderbuffer(renderbuffer %u)", renderbuffer); return; } @@ -2701,7 +2701,7 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment, const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); if (baseFormat != GL_DEPTH_STENCIL) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(renderbuffer" + "glFramebufferRenderbuffer(renderbuffer" " is not DEPTH_STENCIL format)"); return; } @@ -2734,7 +2734,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, buffer = get_framebuffer_target(ctx, target); if (!buffer) { _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(target)"); + "glGetFramebufferAttachmentParameteriv(target)"); return; } @@ -2773,7 +2773,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(attachment)"); + "glGetFramebufferAttachmentParameteriv(attachment)"); return; } @@ -2797,7 +2797,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, stencilAtt = get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT); if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL" + "glGetFramebufferAttachmentParameteriv(DEPTH/STENCIL" " attachments differ)"); return; } @@ -2832,7 +2832,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } else if (att->Type == GL_NONE) { _mesa_error(ctx, err, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + "glGetFramebufferAttachmentParameteriv(pname)"); } else { goto invalid_pname_enum; @@ -2849,7 +2849,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } else if (att->Type == GL_NONE) { _mesa_error(ctx, err, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + "glGetFramebufferAttachmentParameteriv(pname)"); } else { goto invalid_pname_enum; @@ -2860,7 +2860,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, goto invalid_pname_enum; } else if (att->Type == GL_NONE) { _mesa_error(ctx, err, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + "glGetFramebufferAttachmentParameteriv(pname)"); } else if (att->Type == GL_TEXTURE) { if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) { *params = att->Zoffset; @@ -2881,7 +2881,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } else if (att->Type == GL_NONE) { _mesa_error(ctx, err, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + "glGetFramebufferAttachmentParameteriv(pname)"); } else { if (ctx->Extensions.EXT_framebuffer_sRGB) { @@ -2904,7 +2904,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } else if (att->Type == GL_NONE) { _mesa_error(ctx, err, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + "glGetFramebufferAttachmentParameteriv(pname)"); } else { mesa_format format = att->Renderbuffer->Format; @@ -2956,7 +2956,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } else if (att->Type == GL_NONE) { _mesa_error(ctx, err, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + "glGetFramebufferAttachmentParameteriv(pname)"); } else if (att->Texture) { const struct gl_texture_image *texImage = diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index aace8a5b5..da3568469 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -203,10 +203,10 @@ descriptor=[ [ "COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ], [ "COLOR_ARRAY_TYPE", "ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR0].Type), NO_EXTRA" ], [ "COLOR_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA" ], - [ "TEXTURE_COORD_ARRAY", "LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_client_array, Enabled), NO_EXTRA" ], - [ "TEXTURE_COORD_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_client_array, Size), NO_EXTRA" ], - [ "TEXTURE_COORD_ARRAY_TYPE", "LOC_CUSTOM, TYPE_ENUM, offsetof(struct gl_client_array, Type), NO_EXTRA" ], - [ "TEXTURE_COORD_ARRAY_STRIDE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_client_array, Stride), NO_EXTRA" ], + [ "TEXTURE_COORD_ARRAY", "LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_vertex_attrib_array, Enabled), NO_EXTRA" ], + [ "TEXTURE_COORD_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_vertex_attrib_array, Size), NO_EXTRA" ], + [ "TEXTURE_COORD_ARRAY_TYPE", "LOC_CUSTOM, TYPE_ENUM, offsetof(struct gl_vertex_attrib_array, Type), NO_EXTRA" ], + [ "TEXTURE_COORD_ARRAY_STRIDE", "LOC_CUSTOM, TYPE_INT, offsetof(struct gl_vertex_attrib_array, Stride), NO_EXTRA" ], # GL_ARB_multitexture [ "MAX_TEXTURE_UNITS", "CONTEXT_INT(Const.MaxTextureUnits), NO_EXTRA" ], diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c index 4afe156b0..b8c754815 100644 --- a/mesalib/src/mesa/main/imports.c +++ b/mesalib/src/mesa/main/imports.c @@ -209,20 +209,6 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, #endif } - - -/** Reallocate memory */ -void * -_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) -{ - const size_t copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuffer = malloc(newSize); - if (newBuffer && oldBuffer && copySize > 0) - memcpy(newBuffer, oldBuffer, copySize); - free(oldBuffer); - return newBuffer; -} - /*@}*/ @@ -231,7 +217,7 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) /*@{*/ -#ifndef __GNUC__ +#ifndef HAVE___BUILTIN_FFS /** * Find the first bit set in a word. */ @@ -260,8 +246,9 @@ ffs(int i) } return bit; } +#endif - +#ifndef HAVE___BUILTIN_FFSLL /** * Find position of first bit set in given value. * XXX Warning: this function can only be used on 64-bit systems! @@ -285,11 +272,10 @@ ffsll(long long int val) return 0; } -#endif /* __GNUC__ */ +#endif -#if !defined(__GNUC__) ||\ - ((__GNUC__ * 100 + __GNUC_MINOR__) < 304) /* Not gcc 3.4 or later */ +#ifndef HAVE___BUILTIN_POPCOUNT /** * Return number of bits set in given GLuint. */ @@ -302,7 +288,9 @@ _mesa_bitcount(unsigned int n) } return bits; } +#endif +#ifndef HAVE___BUILTIN_POPCOUNTLL /** * Return number of bits set in given 64-bit uint. */ @@ -489,60 +477,6 @@ _mesa_half_to_float(GLhalfARB val) /**********************************************************************/ -/** \name Sort & Search */ -/*@{*/ - -/** - * Wrapper for bsearch(). - */ -void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ) -{ -#if defined(_WIN32_WCE) - void *mid; - int cmp; - while (nmemb) { - nmemb >>= 1; - mid = (char *)base + nmemb * size; - cmp = (*compar)(key, mid); - if (cmp == 0) - return mid; - if (cmp > 0) { - base = (char *)mid + size; - --nmemb; - } - } - return NULL; -#else - return bsearch(key, base, nmemb, size, compar); -#endif -} - -/*@}*/ - - -/**********************************************************************/ -/** \name Environment vars */ -/*@{*/ - -/** - * Wrapper for getenv(). - */ -char * -_mesa_getenv( const char *var ) -{ -#if defined(_XBOX) || defined(_WIN32_WCE) - return NULL; -#else - return getenv(var); -#endif -} - -/*@}*/ - - -/**********************************************************************/ /** \name String */ /*@{*/ diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h index 000fd5b49..725416d06 100755 --- a/mesalib/src/mesa/main/imports.h +++ b/mesalib/src/mesa/main/imports.h @@ -376,8 +376,7 @@ _mesa_is_pow_two(int x) static inline int32_t _mesa_next_pow_two_32(uint32_t x) { -#if defined(__GNUC__) && \ - ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZ uint32_t y = (x != 1); return (1 + y) << ((__builtin_clz(x - y) ^ 31) ); #else @@ -395,13 +394,10 @@ _mesa_next_pow_two_32(uint32_t x) static inline int64_t _mesa_next_pow_two_64(uint64_t x) { -#if defined(__GNUC__) && \ - ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZLL uint64_t y = (x != 1); - if (sizeof(x) == sizeof(long)) - return (1 + y) << ((__builtin_clzl(x - y) ^ 63)); - else - return (1 + y) << ((__builtin_clzll(x - y) ^ 63)); + STATIC_ASSERT(sizeof(x) == sizeof(long long)); + return (1 + y) << ((__builtin_clzll(x - y) ^ 63)); #else x--; x |= x >> 1; @@ -422,8 +418,7 @@ _mesa_next_pow_two_64(uint64_t x) static inline GLuint _mesa_logbase2(GLuint n) { -#if defined(__GNUC__) && \ - ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_CLZ return (31 - __builtin_clz(n | 1)); #else GLuint pos = 0; @@ -472,28 +467,33 @@ _mesa_exec_malloc( GLuint size ); extern void _mesa_exec_free( void *addr ); -extern void * -_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); - #ifndef FFS_DEFINED #define FFS_DEFINED 1 -#ifdef __GNUC__ +#ifdef HAVE___BUILTIN_FFS #define ffs __builtin_ffs -#define ffsll __builtin_ffsll #else extern int ffs(int i); +#endif + +#ifdef HAVE___BUILTIN_FFSLL +#define ffsll __builtin_ffsll +#else extern int ffsll(long long int i); -#endif /*__ GNUC__ */ +#endif #endif /* FFS_DEFINED */ -#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) /* gcc 3.4 or later */ +#ifdef HAVE___BUILTIN_POPCOUNT #define _mesa_bitcount(i) __builtin_popcount(i) -#define _mesa_bitcount_64(i) __builtin_popcountll(i) #else extern unsigned int _mesa_bitcount(unsigned int n); +#endif + +#ifdef HAVE___BUILTIN_POPCOUNTLL +#define _mesa_bitcount_64(i) __builtin_popcountll(i) +#else extern unsigned int _mesa_bitcount_64(uint64_t n); #endif @@ -506,7 +506,7 @@ _mesa_bitcount_64(uint64_t n); static inline unsigned int _mesa_fls(unsigned int n) { -#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304) +#ifdef HAVE___BUILTIN_CLZ return n == 0 ? 0 : 32 - __builtin_clz(n); #else unsigned int v = 1; @@ -536,13 +536,6 @@ _mesa_half_is_negative(GLhalfARB h) return h & 0x8000; } -extern void * -_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *) ); - -extern char * -_mesa_getenv( const char *var ); - extern char * _mesa_strdup( const char *s ); diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h index 7a4a337d9..5fc8f6b08 100755 --- a/mesalib/src/mesa/main/macros.h +++ b/mesalib/src/mesa/main/macros.h @@ -799,13 +799,6 @@ NORMALIZE_3FV(GLfloat v[3]) } -/** Is float value negative? */ -static inline GLboolean -IS_NEGATIVE(float x) -{ - return signbit(x) != 0; -} - /** Test two floats have opposite signs */ static inline GLboolean DIFFERENT_SIGNS(GLfloat x, GLfloat y) diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 553a21667..dd330eab7 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -3452,7 +3452,7 @@ struct gl_constants GLuint MaxGeometryOutputVertices; GLuint MaxGeometryTotalOutputComponents; - GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */ + GLuint GLSLVersion; /**< Desktop GLSL version supported (ex: 120 = 1.20) */ /** * Changes default GLSL extension behavior from "error" to "warn". It's out @@ -3552,11 +3552,6 @@ struct gl_constants GLboolean GLSLSkipStrictMaxUniformLimitCheck; /** - * Force software support for primitive restart in the VBO module. - */ - GLboolean PrimitiveRestartInSoftware; - - /** * Always use the GetTransformFeedbackVertexCount() driver hook, rather * than passing the transform feedback object to the drawing function. */ @@ -3576,6 +3571,19 @@ struct gl_constants */ GLboolean DisableVaryingPacking; + /** + * Should meaningful names be generated for compiler temporary variables? + * + * Generally, it is not useful to have the compiler generate "meaningful" + * names for temporary variables that it creates. This can, however, be a + * useful debugging aid. In Mesa debug builds or release builds when + * MESA_GLSL is set at run-time, meaningful names will be generated. + * Drivers can also force names to be generated by setting this field. + * For example, the i965 driver may set it when INTEL_DEBUG=vs (to dump + * vertex shader assembly) is set at run-time. + */ + bool GenerateTemporaryNames; + /* * Maximum value supported for an index in DrawElements and friends. * diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 620cab3cc..3e6f61067 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -70,7 +70,7 @@ GLbitfield _mesa_get_shader_flags(void) { GLbitfield flags = 0x0; - const char *env = _mesa_getenv("MESA_GLSL"); + const char *env = getenv("MESA_GLSL"); if (env) { if (strstr(env, "dump_on_error")) @@ -123,6 +123,9 @@ _mesa_init_shader_state(struct gl_context *ctx) ctx->Shader.Flags = _mesa_get_shader_flags(); + if (ctx->Shader.Flags != 0) + ctx->Const.GenerateTemporaryNames = true; + /* Extended for ARB_separate_shader_objects */ ctx->Shader.RefCount = 1; mtx_init(&ctx->Shader.Mutex, mtx_plain); @@ -272,9 +275,8 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader) /* grow list */ shProg->Shaders = (struct gl_shader **) - _mesa_realloc(shProg->Shaders, - n * sizeof(struct gl_shader *), - (n + 1) * sizeof(struct gl_shader *)); + realloc(shProg->Shaders, + (n + 1) * sizeof(struct gl_shader *)); if (!shProg->Shaders) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAttachShader"); return; diff --git a/mesalib/src/mesa/main/shaderobj.h b/mesalib/src/mesa/main/shaderobj.h index fae8be827..d72919c1f 100644 --- a/mesalib/src/mesa/main/shaderobj.h +++ b/mesalib/src/mesa/main/shaderobj.h @@ -94,13 +94,6 @@ _mesa_free_shader_program_data(struct gl_context *ctx, extern void _mesa_init_shader_object_functions(struct dd_function_table *driver); -extern void -_mesa_init_shader_state(struct gl_context *ctx); - -extern void -_mesa_free_shader_state(struct gl_context *ctx); - - static inline gl_shader_stage _mesa_shader_enum_to_shader_stage(GLenum v) { diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c index 5b275efe0..254f84ef7 100644 --- a/mesalib/src/mesa/main/texcompress_s3tc.c +++ b/mesalib/src/mesa/main/texcompress_s3tc.c @@ -51,8 +51,6 @@ #define DXTN_LIBNAME "dxtn.dll" #define RTLD_LAZY 0 #define RTLD_GLOBAL 0 -#elif defined(__DJGPP__) -#define DXTN_LIBNAME "dxtn.dxe" #else #define DXTN_LIBNAME "libtxc_dxtn.so" #endif diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index ead78649d..09bf52c42 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -711,7 +711,7 @@ _mesa_EnableVertexAttribArray(GLuint index) vao = ctx->Array.VAO; - ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->_VertexAttrib)); + ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib)); if (!vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) { /* was disabled, now being enabled */ @@ -737,7 +737,7 @@ _mesa_DisableVertexAttribArray(GLuint index) vao = ctx->Array.VAO; - ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->_VertexAttrib)); + ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(vao->VertexAttrib)); if (vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) { /* was enabled, now being disabled */ @@ -831,7 +831,7 @@ get_current_attrib(struct gl_context *ctx, GLuint index, const char *function) return NULL; } - ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->_VertexAttrib)); + ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib)); FLUSH_CURRENT(ctx, 0); return ctx->Current.Attrib[VERT_ATTRIB_GENERIC(index)]; @@ -953,7 +953,7 @@ _mesa_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid **pointer) return; } - ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->_VertexAttrib)); + ASSERT(VERT_ATTRIB_GENERIC(index) < Elements(ctx->Array.VAO->VertexAttrib)); *pointer = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr; } diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c index 126032740..e3a63811a 100644 --- a/mesalib/src/mesa/main/version.c +++ b/mesalib/src/mesa/main/version.c @@ -57,13 +57,15 @@ check_for_ending(const char *string, const char *ending) * fwd_context is only valid if version > 0 */ static void -get_gl_override(int *version, GLboolean *fwd_context) +get_gl_override(int *version, GLboolean *fwd_context, + GLboolean *compat_context) { const char *env_var = "MESA_GL_VERSION_OVERRIDE"; const char *version_str; int major, minor, n; static int override_version = -1; static GLboolean fc_suffix = GL_FALSE; + static GLboolean compat_suffix = GL_FALSE; if (override_version < 0) { override_version = 0; @@ -71,6 +73,7 @@ get_gl_override(int *version, GLboolean *fwd_context) version_str = getenv(env_var); if (version_str) { fc_suffix = check_for_ending(version_str, "FC"); + compat_suffix = check_for_ending(version_str, "COMPAT"); n = sscanf(version_str, "%u.%u", &major, &minor); if (n != 2) { @@ -87,6 +90,7 @@ get_gl_override(int *version, GLboolean *fwd_context) *version = override_version; *fwd_context = fc_suffix; + *compat_context = compat_suffix; } /** @@ -129,16 +133,16 @@ _mesa_override_gl_version_contextless(struct gl_constants *consts, gl_api *apiOut, GLuint *versionOut) { int version; - GLboolean fwd_context; + GLboolean fwd_context, compat_context; - get_gl_override(&version, &fwd_context); + get_gl_override(&version, &fwd_context, &compat_context); if (version > 0) { *versionOut = version; if (version >= 30 && fwd_context) { *apiOut = API_OPENGL_CORE; consts->ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT; - } else if (version >= 31) { + } else if (version >= 31 && !compat_context) { *apiOut = API_OPENGL_CORE; } else { *apiOut = API_OPENGL_COMPAT; @@ -166,9 +170,9 @@ int _mesa_get_gl_version_override(void) { int version; - GLboolean fwd_context; + GLboolean fwd_context, compat_context; - get_gl_override(&version, &fwd_context); + get_gl_override(&version, &fwd_context, &compat_context); return version; } diff --git a/mesalib/src/mesa/main/viewport.c b/mesalib/src/mesa/main/viewport.c index 6545bf68a..222ae307b 100644 --- a/mesalib/src/mesa/main/viewport.c +++ b/mesalib/src/mesa/main/viewport.c @@ -58,6 +58,12 @@ set_viewport_no_notify(struct gl_context *ctx, unsigned idx, ctx->Const.ViewportBounds.Min, ctx->Const.ViewportBounds.Max); } + if (ctx->ViewportArray[idx].X == x && + ctx->ViewportArray[idx].Width == width && + ctx->ViewportArray[idx].Y == y && + ctx->ViewportArray[idx].Height == height) + return; + ctx->ViewportArray[idx].X = x; ctx->ViewportArray[idx].Width = width; ctx->ViewportArray[idx].Y = y; |