diff options
Diffstat (limited to 'mesalib/src/mesa')
22 files changed, 189 insertions, 117 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c index bb2164276..bb2164276 100644..100755 --- a/mesalib/src/mesa/drivers/common/meta_blit.c +++ b/mesalib/src/mesa/drivers/common/meta_blit.c diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index d6e875fcf..28923319d 100644..100755 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -116,6 +116,8 @@ driCreateNewScreen2(int scrn, int fd, { static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; + int gl_version_override; + int i; psp = calloc(1, sizeof(*psp)); if (!psp) @@ -128,7 +130,7 @@ driCreateNewScreen2(int scrn, int fd, * (megadrivers), use that instead. */ if (driver_extensions) { - for (int i = 0; driver_extensions[i]; i++) { + for (i = 0; driver_extensions[i]; i++) { if (strcmp(driver_extensions[i]->name, __DRI_DRIVER_VTABLE) == 0) { psp->driver = ((__DRIDriverVtableExtension *)driver_extensions[i])->vtable; @@ -162,7 +164,7 @@ driCreateNewScreen2(int scrn, int fd, return NULL; } - int gl_version_override = _mesa_get_gl_version_override(); + gl_version_override = _mesa_get_gl_version_override(); if (gl_version_override >= 31) { psp->max_gl_core_version = MAX2(psp->max_gl_core_version, gl_version_override); @@ -310,6 +312,8 @@ driCreateContextAttribs(__DRIscreen *screen, int api, unsigned minor_version = 0; uint32_t flags = 0; bool notify_reset = false; + unsigned i; + struct gl_context *ctx; assert((num_attribs == 0) || (attribs != NULL)); @@ -337,7 +341,7 @@ driCreateContextAttribs(__DRIscreen *screen, int api, return NULL; } - for (unsigned i = 0; i < num_attribs; i++) { + for (i = 0; i < num_attribs; i++) { switch (attribs[i * 2]) { case __DRI_CTX_ATTRIB_MAJOR_VERSION: major_version = attribs[i * 2 + 1]; @@ -734,36 +738,36 @@ driSwapBuffers(__DRIdrawable *pdp) /** Core interface */ const __DRIcoreExtension driCoreExtension = { - .base = { __DRI_CORE, 1 }, - - .createNewScreen = NULL, - .destroyScreen = driDestroyScreen, - .getExtensions = driGetExtensions, - .getConfigAttrib = driGetConfigAttrib, - .indexConfigAttrib = driIndexConfigAttrib, - .createNewDrawable = NULL, - .destroyDrawable = driDestroyDrawable, - .swapBuffers = driSwapBuffers, /* swrast */ - .createNewContext = driCreateNewContext, /* swrast */ - .copyContext = driCopyContext, - .destroyContext = driDestroyContext, - .bindContext = driBindContext, - .unbindContext = driUnbindContext + /*.base =*/ { __DRI_CORE, 1 }, + + /*.createNewScreen =*/ NULL, + /*.destroyScreen =*/ driDestroyScreen, + /*.getExtensions =*/ driGetExtensions, + /*.getConfigAttrib =*/ driGetConfigAttrib, + /*.indexConfigAttrib =*/ driIndexConfigAttrib, + /*.createNewDrawable =*/ NULL, + /*.destroyDrawable =*/ driDestroyDrawable, + /*.swapBuffers =*/ driSwapBuffers, /* swrast */ + /*.createNewContext =*/ driCreateNewContext, /* swrast */ + /*.copyContext =*/ driCopyContext, + /*.destroyContext =*/ driDestroyContext, + /*.bindContext =*/ driBindContext, + /*.unbindContext =*/ driUnbindContext }; /** DRI2 interface */ const __DRIdri2Extension driDRI2Extension = { - .base = { __DRI_DRI2, 4 }, - - .createNewScreen = dri2CreateNewScreen, - .createNewDrawable = driCreateNewDrawable, - .createNewContext = driCreateNewContext, - .getAPIMask = driGetAPIMask, - .createNewContextForAPI = driCreateNewContextForAPI, - .allocateBuffer = dri2AllocateBuffer, - .releaseBuffer = dri2ReleaseBuffer, - .createContextAttribs = driCreateContextAttribs, - .createNewScreen2 = driCreateNewScreen2, + /*.base =*/ { __DRI_DRI2, 4 }, + + /*.createNewScreen =*/ dri2CreateNewScreen, + /*.createNewDrawable =*/ driCreateNewDrawable, + /*.createNewContext =*/ driCreateNewContext, + /*.getAPIMask =*/ driGetAPIMask, + /*.createNewContextForAPI =*/ driCreateNewContextForAPI, + /*.allocateBuffer =*/ dri2AllocateBuffer, + /*.releaseBuffer =*/ dri2ReleaseBuffer, + /*.createContextAttribs =*/ driCreateContextAttribs, + /*.createNewScreen2 =*/ driCreateNewScreen2, }; const __DRIswrastExtension driSWRastExtension = { @@ -777,11 +781,11 @@ const __DRIswrastExtension driSWRastExtension = { }; const __DRI2configQueryExtension dri2ConfigQueryExtension = { - .base = { __DRI2_CONFIG_QUERY, 1 }, + /*.base =*/ { __DRI2_CONFIG_QUERY, 1 }, - .configQueryb = dri2ConfigQueryb, - .configQueryi = dri2ConfigQueryi, - .configQueryf = dri2ConfigQueryf, + /*.configQueryb =*/ dri2ConfigQueryb, + /*.configQueryi =*/ dri2ConfigQueryi, + /*.configQueryf =*/ dri2ConfigQueryf, }; void @@ -873,12 +877,12 @@ driImageFormatToGLFormat(uint32_t image_format) /** Image driver interface */ const __DRIimageDriverExtension driImageDriverExtension = { - .base = { __DRI_IMAGE_DRIVER, 1 }, + /*.base =*/ { __DRI_IMAGE_DRIVER, 1 }, - .createNewScreen2 = driCreateNewScreen2, - .createNewDrawable = driCreateNewDrawable, - .getAPIMask = driGetAPIMask, - .createContextAttribs = driCreateContextAttribs, + /*.createNewScreen2 =*/ driCreateNewScreen2, + /*.createNewDrawable =*/ driCreateNewDrawable, + /*.createContextAttribs =*/ driCreateContextAttribs, + /*.getAPIMask =*/ driGetAPIMask, }; /* swrast copy sub buffer entrypoint. */ @@ -892,7 +896,7 @@ static void driCopySubBuffer(__DRIdrawable *pdp, int x, int y, /* for swrast only */ const __DRIcopySubBufferExtension driCopySubBufferExtension = { - .base = { __DRI_COPY_SUB_BUFFER, 1 }, + /*.base =*/ { __DRI_COPY_SUB_BUFFER, 1 }, - .copySubBuffer = driCopySubBuffer, + /*.copySubBuffer =*/ driCopySubBuffer, }; diff --git a/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c b/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c index d085080a1..f0c8878a8 100644 --- a/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c +++ b/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c @@ -162,5 +162,5 @@ __DRIconfig **stub_error_init_screen(__DRIscreen *psp) * never be used. */ const struct __DriverAPIRec driDriverAPI = { - .InitScreen = stub_error_init_screen, + /*.InitScreen = */stub_error_init_screen, }; diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c index 2b284ccf2..a90a97fa9 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c +++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c @@ -104,7 +104,11 @@ static const char *__getProgramName () { # define GET_PROGRAM_NAME() __getProgramName() # else # define GET_PROGRAM_NAME() "" +# ifdef _MSC_VER +# pragma message("Per application configuration won't work with your OS version.") +# else # warning "Per application configuration won't work with your OS version." +# endif # endif #endif @@ -289,6 +293,29 @@ static float strToF (const XML_Char *string, const XML_Char **tail) { return result; } +#if !defined(HAVE_STRNDUP)
+
+/* Emulates glibc's strndup() */
+char *
+strndup(const char *str, size_t size)
+{
+ size_t len;
+ char *result = (char *)NULL;
+
+ if ((char *)NULL == str) return (char *)NULL;
+
+ len = strlen(str);
+ if (!len) return strdup("");
+ if (size > len) size = len;
+
+ result = (char *)malloc((size + 1) * sizeof (char));
+ memcpy(result, str, size);
+ result[size] = 0x0;
+ return result;
+}
+
+#endif /* _WIN32 should be !HAVE_STRNDUP */
+ /** \brief Parse a value of a given type. */ static unsigned char parseValue (driOptionValue *v, driOptionType type, const XML_Char *string) { @@ -449,11 +476,11 @@ __driUtilMessage(const char *f, ...) (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser)); \ } while (0) -#define XML_WARNING(msg,args...) do { \ +#define XML_WARNING(msg, ...) do { \ __driUtilMessage ("Warning in %s line %d, column %d: "msg, data->name, \ (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser), \ - args); \ + __VA_ARGS__); \ } while (0) /** \brief Output an error message. */ #define XML_ERROR1(msg) do { \ @@ -461,11 +488,11 @@ __driUtilMessage(const char *f, ...) (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser)); \ } while (0) -#define XML_ERROR(msg,args...) do { \ +#define XML_ERROR(msg, ...) do { \ __driUtilMessage ("Error in %s line %d, column %d: "msg, data->name, \ (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser), \ - args); \ + __VA_ARGS__); \ } while (0) /** \brief Output a fatal error message and abort. */ #define XML_FATAL1(msg) do { \ @@ -475,12 +502,12 @@ __driUtilMessage(const char *f, ...) (int) XML_GetCurrentColumnNumber(data->parser)); \ abort();\ } while (0) -#define XML_FATAL(msg,args...) do { \ +#define XML_FATAL(msg, ...) do { \ fprintf (stderr, "Fatal error in %s line %d, column %d: "msg"\n", \ data->name, \ (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser), \ - args); \ + __VA_ARGS__); \ abort();\ } while (0) diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.h b/mesalib/src/mesa/drivers/dri/common/xmlconfig.h index 8969843bd..8969843bd 100644..100755 --- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.h +++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.h diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index fb29078b6..e84059073 100644..100755 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -33,6 +33,11 @@ */ #include <stdio.h> +#ifdef _MSC_VER +#define WIN32_LEAN_AND_MEAN 1 +#include <windows.h> +#endif + #include "main/api_exec.h" #include "main/context.h" #include "main/extensions.h" @@ -61,7 +66,7 @@ #include "swrast_priv.h" #include "swrast/s_context.h" -const __DRIextension **__driDriverGetExtensions_swrast(void); +PUBLIC const __DRIextension **__driDriverGetExtensions_swrast(void); const char * const swrast_vendor_string = "Mesa Project"; const char * const swrast_renderer_string = "Software Rasterizer"; @@ -82,7 +87,7 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, uint32_t internalFormat; mesa_format texFormat; - dri_ctx = pDRICtx->driverPrivate; + dri_ctx = (struct dri_context *)pDRICtx->driverPrivate; internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4); @@ -138,6 +143,7 @@ swrast_query_renderer_integer(__DRIscreen *psp, int param, return 0; case __DRI2_RENDERER_VIDEO_MEMORY: { /* XXX: Do we want to return the full amount of system memory ? */ +#ifndef _MSC_VER const long system_memory_pages = sysconf(_SC_PHYS_PAGES); const long system_page_size = sysconf(_SC_PAGE_SIZE); @@ -152,6 +158,9 @@ swrast_query_renderer_integer(__DRIscreen *psp, int param, value[0] = system_memory_megabytes; return 0; +#else + return -1; +#endif } case __DRI2_RENDERER_UNIFIED_MEMORY_ARCHITECTURE: /** @@ -246,7 +255,7 @@ swrastFillInModes(__DRIscreen *psp, format = MESA_FORMAT_B8G8R8A8_UNORM; break; default: - fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__, + fprintf(stderr, "[%s:%u] bad depth %d\n", __FUNCTION__, __LINE__, pixel_bits); return NULL; } @@ -257,7 +266,7 @@ swrastFillInModes(__DRIscreen *psp, back_buffer_factor, msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, + fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __FUNCTION__, __LINE__); return NULL; } @@ -381,7 +390,7 @@ swrast_alloc_back_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, swrast_alloc_front_storage(ctx, rb, internalFormat, width, height); - xrb->Base.Buffer = malloc(height * xrb->pitch); + xrb->Base.Buffer = (GLubyte*)malloc(height * xrb->pitch); return GL_TRUE; } @@ -390,7 +399,7 @@ static struct dri_swrast_renderbuffer * swrast_new_renderbuffer(const struct gl_config *visual, __DRIdrawable *dPriv, GLboolean front) { - struct dri_swrast_renderbuffer *xrb = calloc(1, sizeof *xrb); + struct dri_swrast_renderbuffer *xrb = (struct dri_swrast_renderbuffer *)calloc(1, sizeof *xrb); struct gl_renderbuffer *rb; GLuint pixel_format; @@ -471,7 +480,7 @@ swrast_map_renderbuffer(struct gl_context *ctx, xrb->map_h = h; stride = w * cpp; - xrb->Base.Buffer = malloc(h * stride); + xrb->Base.Buffer = (GLubyte*)malloc(h * stride); sPriv->swrast_loader->getImage(dPriv, x, rb->Height - y - h, w, h, (char *) xrb->Base.Buffer, @@ -540,7 +549,7 @@ dri_create_buffer(__DRIscreen * sPriv, dPriv->driverPrivate = drawable; drawable->dPriv = dPriv; - drawable->row = malloc(SWRAST_MAX_WIDTH * 4); + drawable->row = (char*)malloc(SWRAST_MAX_WIDTH * 4); if (drawable->row == NULL) goto drawable_fail; @@ -921,21 +930,23 @@ dri_copy_sub_buffer(__DRIdrawable *dPriv, int x, int y, static const struct __DriverAPIRec swrast_driver_api = { - .InitScreen = dri_init_screen, - .DestroyScreen = dri_destroy_screen, - .CreateContext = dri_create_context, - .DestroyContext = dri_destroy_context, - .CreateBuffer = dri_create_buffer, - .DestroyBuffer = dri_destroy_buffer, - .SwapBuffers = dri_swap_buffers, - .MakeCurrent = dri_make_current, - .UnbindContext = dri_unbind_context, - .CopySubBuffer = dri_copy_sub_buffer, + /*.InitScreen = */dri_init_screen, + /*.DestroyScreen = */dri_destroy_screen, + /*.CreateContext = */dri_create_context, + /*.DestroyContext = */dri_destroy_context, + /*.CreateBuffer = */dri_create_buffer, + /*.DestroyBuffer = */dri_destroy_buffer, + /*.SwapBuffers = */dri_swap_buffers, + /*.MakeCurrent = */dri_make_current, + /*.UnbindContext = */dri_unbind_context, + /*.CopySubBuffer = */dri_copy_sub_buffer, + /*.AllocateBuffer = */NULL, + /*.ReleaseBuffer = */NULL }; static const struct __DRIDriverVtableExtensionRec swrast_vtable = { - .base = { __DRI_DRIVER_VTABLE, 1 }, - .vtable = &swrast_driver_api, + /*.base = */{ __DRI_DRIVER_VTABLE, 1 }, + /*.vtable = */&swrast_driver_api, }; static const __DRIextension *swrast_driver_extensions[] = { diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h b/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h index 1f3a48f38..8dccc2265 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -33,6 +33,13 @@ #include "dri_util.h" #include "swrast/s_context.h" +#ifdef _MSC_VER +#ifdef PUBLIC +#undef PUBLIC +#endif +#define PUBLIC __declspec(dllexport) +#endif + /** * Debugging diff --git a/mesalib/src/mesa/main/.gitignore b/mesalib/src/mesa/main/.gitignore index 8256ad792..54885405f 100644..100755 --- a/mesalib/src/mesa/main/.gitignore +++ b/mesalib/src/mesa/main/.gitignore @@ -1,11 +1,12 @@ -api_exec.c -dispatch.h -enums.c -git_sha1.h -git_sha1.h.tmp -remap_helper.h -get_hash.h -get_hash.h.tmp -format_info.h -format_pack.c -format_unpack.c +api_exec.c
+dispatch.h
+enums.c
+git_sha1.h
+git_sha1.h.tmp
+remap_helper.h
+get_hash.h
+get_hash.h.tmp
+format_info.h
+glapitable.h
+format_pack.c
+format_unpack.c
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index e1c587779..008d1aa5f 100644..100755 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -393,7 +393,7 @@ convert_clear_buffer_data(struct gl_context *ctx, * * Default callback for the \c dd_function_table::NewBufferObject() hook. */ -static struct gl_buffer_object * +struct gl_buffer_object * _mesa_new_buffer_object(struct gl_context *ctx, GLuint name) { struct gl_buffer_object *obj; @@ -411,7 +411,7 @@ _mesa_new_buffer_object(struct gl_context *ctx, GLuint name) * * Default callback for the \c dd_function_table::DeleteBuffer() hook. */ -static void +void _mesa_delete_buffer_object(struct gl_context *ctx, struct gl_buffer_object *bufObj) { @@ -560,7 +560,7 @@ _mesa_total_buffer_object_memory(struct gl_context *ctx) * \return GL_TRUE for success, GL_FALSE for failure * \sa glBufferDataARB, dd_function_table::BufferData. */ -static GLboolean +GLboolean _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage, GLenum storageFlags, struct gl_buffer_object * bufObj ) @@ -606,7 +606,7 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size, * * \sa glBufferSubDataARB, dd_function_table::BufferSubData. */ -static void +void _mesa_buffer_subdata( struct gl_context *ctx, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data, struct gl_buffer_object * bufObj ) @@ -639,7 +639,7 @@ _mesa_buffer_subdata( struct gl_context *ctx, GLintptrARB offset, * * \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData. */ -static void +void _mesa_buffer_get_subdata( struct gl_context *ctx, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data, struct gl_buffer_object * bufObj ) @@ -752,7 +752,7 @@ _mesa_buffer_flush_mapped_range( struct gl_context *ctx, * * \sa glUnmapBufferARB, dd_function_table::UnmapBuffer */ -static GLboolean +GLboolean _mesa_buffer_unmap(struct gl_context *ctx, struct gl_buffer_object *bufObj, gl_map_buffer_index index) { diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h index 5a66a4eec..a011319b9 100644 --- a/mesalib/src/mesa/main/config.h +++ b/mesalib/src/mesa/main/config.h @@ -32,6 +32,10 @@ #define MESA_CONFIG_H_INCLUDED +#define PACKAGE_VERSION "9.2-devel" +#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa" + + /** * \name OpenGL implementation limits */ diff --git a/mesalib/src/mesa/main/dlopen.h b/mesalib/src/mesa/main/dlopen.h index 1e7784914..93d1258cf 100644 --- a/mesalib/src/mesa/main/dlopen.h +++ b/mesalib/src/mesa/main/dlopen.h @@ -50,7 +50,7 @@ _mesa_dlopen(const char *libname, int flags) #if defined(HAVE_DLOPEN) flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */ return dlopen(libname, flags); -#elif defined(__MINGW32__) +#elif defined(__MINGW32__) || defined(_WIN32) return LoadLibraryA(libname); #else return NULL; @@ -71,7 +71,7 @@ _mesa_dlsym(void *handle, const char *fname) } u; #if defined(HAVE_DLOPEN) u.v = dlsym(handle, fname); -#elif defined(__MINGW32__) +#elif defined(__MINGW32__) || defined(_WIN32) u.v = (void *) GetProcAddress(handle, fname); #else u.v = NULL; @@ -87,7 +87,7 @@ _mesa_dlclose(void *handle) { #if defined(HAVE_DLOPEN) dlclose(handle); -#elif defined(__MINGW32__) +#elif defined(__MINGW32__) || defined(_WIN32) FreeLibrary(handle); #else (void) handle; diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h index 792100061..c211b1555 100644..100755 --- a/mesalib/src/mesa/main/imports.h +++ b/mesalib/src/mesa/main/imports.h @@ -86,7 +86,6 @@ typedef union { GLfloat f; GLint i; GLuint u; } fi_type; #if _MSC_VER < 1800 /* Not req'd on VS2013 and above */ #define strtoll(p, e, b) _strtoi64(p, e, b) #endif /* _MSC_VER < 1800 */ -#define strcasecmp(s1, s2) _stricmp(s1, s2) #endif /*@}*/ diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h index 2d7a6a107..b22510965 100644..100755 --- a/mesalib/src/mesa/main/macros.h +++ b/mesalib/src/mesa/main/macros.h @@ -154,21 +154,21 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; else if (__tmp.i >= IEEE_ONE) \ UB = (GLubyte) 255; \ else { \ - __tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \ + __tmp.f = __tmp.f * (255.0f/256.0f) + 32768.0f; \ UB = (GLubyte) __tmp.i; \ } \ } while (0) #define CLAMPED_FLOAT_TO_UBYTE(UB, FLT) \ do { \ fi_type __tmp; \ - __tmp.f = (FLT) * (255.0F/256.0F) + 32768.0F; \ + __tmp.f = (FLT) * (255.0f/256.0f) + 32768.0f; \ UB = (GLubyte) __tmp.i; \ } while (0) #else -#define UNCLAMPED_FLOAT_TO_UBYTE(ub, f) \ - ub = ((GLubyte) F_TO_I(CLAMP((f), 0.0F, 1.0F) * 255.0F)) -#define CLAMPED_FLOAT_TO_UBYTE(ub, f) \ - ub = ((GLubyte) F_TO_I((f) * 255.0F)) +#define UNCLAMPED_FLOAT_TO_UBYTE(ub, FLT) \ + ub = ((GLubyte) F_TO_I(CLAMP((FLT), 0.0f, 1.0f) * 255.0f)) +#define CLAMPED_FLOAT_TO_UBYTE(ub, FLT) \ + ub = ((GLubyte) F_TO_I((FLT) * 255.0f)) #endif static fi_type UINT_AS_UNION(GLuint u) diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index 0842b540d..9ecc7d3b5 100644..100755 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -40,7 +40,7 @@ * \param id - the new object's ID * \return pointer to new query_object object or NULL if out of memory. */ -static struct gl_query_object * +struct gl_query_object * _mesa_new_query_object(struct gl_context *ctx, GLuint id) { struct gl_query_object *q = CALLOC_STRUCT(gl_query_object); @@ -72,7 +72,7 @@ _mesa_new_query_object(struct gl_context *ctx, GLuint id) * Begin a query. Software driver fallback. * Called via ctx->Driver.BeginQuery(). */ -static void +void _mesa_begin_query(struct gl_context *ctx, struct gl_query_object *q) { ctx->NewState |= _NEW_DEPTH; /* for swrast */ @@ -83,7 +83,7 @@ _mesa_begin_query(struct gl_context *ctx, struct gl_query_object *q) * End a query. Software driver fallback. * Called via ctx->Driver.EndQuery(). */ -static void +void _mesa_end_query(struct gl_context *ctx, struct gl_query_object *q) { ctx->NewState |= _NEW_DEPTH; /* for swrast */ @@ -95,7 +95,7 @@ _mesa_end_query(struct gl_context *ctx, struct gl_query_object *q) * Wait for query to complete. Software driver fallback. * Called via ctx->Driver.WaitQuery(). */ -static void +void _mesa_wait_query(struct gl_context *ctx, struct gl_query_object *q) { /* For software drivers, _mesa_end_query() should have completed the query. @@ -123,7 +123,7 @@ _mesa_check_query(struct gl_context *ctx, struct gl_query_object *q) * Delete a query object. Called via ctx->Driver.DeleteQuery(). * Not removed from hash table here. */ -static void +void _mesa_delete_query(struct gl_context *ctx, struct gl_query_object *q) { free(q->Label); diff --git a/mesalib/src/mesa/main/remap.c b/mesalib/src/mesa/main/remap.c index 5a9538772..74a2e481d 100644 --- a/mesalib/src/mesa/main/remap.c +++ b/mesalib/src/mesa/main/remap.c @@ -35,9 +35,9 @@ * a dynamic entry, or the corresponding static entry, in glapi. */ +#include "glapi/glapi.h" #include "remap.h" #include "imports.h" -#include "glapi/glapi.h" #define MAX_ENTRY_POINTS 16 @@ -46,7 +46,7 @@ /* this is global for quick access */ -int driDispatchRemapTable[driDispatchRemapTable_size]; +SERVEXTERN int driDispatchRemapTable[driDispatchRemapTable_size]; /** diff --git a/mesalib/src/mesa/main/remap.h b/mesalib/src/mesa/main/remap.h index 9d91b83c1..c55a93a2d 100644 --- a/mesalib/src/mesa/main/remap.h +++ b/mesalib/src/mesa/main/remap.h @@ -38,7 +38,7 @@ struct gl_function_remap { }; -extern int +SERVEXTERN int driDispatchRemapTable[]; extern const char * diff --git a/mesalib/src/mesa/main/syncobj.c b/mesalib/src/mesa/main/syncobj.c index c1b2d3bed..ac130926a 100644 --- a/mesalib/src/mesa/main/syncobj.c +++ b/mesalib/src/mesa/main/syncobj.c @@ -127,7 +127,7 @@ _mesa_wait_sync(struct gl_context *ctx, struct gl_sync_object *syncObj, } -void +void GLAPIENTRY _mesa_init_sync_object_functions(struct dd_function_table *driver) { driver->NewSyncObject = _mesa_new_sync_object; @@ -144,7 +144,7 @@ _mesa_init_sync_object_functions(struct dd_function_table *driver) /** * Allocate/init the context state related to sync objects. */ -void +void GLAPIENTRY _mesa_init_sync(struct gl_context *ctx) { (void) ctx; @@ -154,7 +154,7 @@ _mesa_init_sync(struct gl_context *ctx) /** * Free the context state related to sync objects. */ -void +void GLAPIENTRY _mesa_free_sync_data(struct gl_context *ctx) { (void) ctx; @@ -179,7 +179,7 @@ _mesa_validate_sync(struct gl_context *ctx, } -void +void GLAPIENTRY _mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) { mtx_lock(&ctx->Shared->Mutex); @@ -188,7 +188,7 @@ _mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) } -void +void GLAPIENTRY _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) { struct set_entry *entry; diff --git a/mesalib/src/mesa/main/syncobj.h b/mesalib/src/mesa/main/syncobj.h index 5d510e873..1dbb7b14a 100644 --- a/mesalib/src/mesa/main/syncobj.h +++ b/mesalib/src/mesa/main/syncobj.h @@ -38,19 +38,19 @@ struct dd_function_table; struct gl_context; struct gl_sync_object; -extern void +extern void GLAPIENTRY _mesa_init_sync_object_functions(struct dd_function_table *driver); -extern void +extern void GLAPIENTRY _mesa_init_sync(struct gl_context *); -extern void +extern void GLAPIENTRY _mesa_free_sync_data(struct gl_context *); -extern void +extern void GLAPIENTRY _mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj); -extern void +extern void GLAPIENTRY _mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj); extern bool diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c index 8e0c3ef5b..d8e22d438 100644 --- a/mesalib/src/mesa/main/version.c +++ b/mesalib/src/mesa/main/version.c @@ -27,7 +27,7 @@ #include "imports.h" #include "mtypes.h" #include "version.h" -#include "git_sha1.h" +/*#include "git_sha1.h"*/ /** * Scans 'string' to see if it ends with 'ending'. diff --git a/mesalib/src/mesa/program/.gitignore b/mesalib/src/mesa/program/.gitignore index 4c20872e1..2f1601fcc 100644..100755 --- a/mesalib/src/mesa/program/.gitignore +++ b/mesalib/src/mesa/program/.gitignore @@ -1,4 +1,4 @@ -program_parse.output -lex.yy.c -program_parse.tab.c -program_parse.tab.h +lex.yy.c
+program_parse.output
+program_parse.tab.c
+program_parse.tab.h
\ No newline at end of file diff --git a/mesalib/src/mesa/program/doflexbison.bat b/mesalib/src/mesa/program/doflexbison.bat new file mode 100644 index 000000000..b39b53cf8 --- /dev/null +++ b/mesalib/src/mesa/program/doflexbison.bat @@ -0,0 +1,18 @@ +@echo off
+setlocal
+
+cd "%~dp0"
+
+set M4=..\..\..\..\tools\mhmake\m4.exe
+set BISON_PKGDATADIR=../../../../tools/mhmake/src/bisondata
+
+set path=..\..\..\..\tools\mhmake;%path%
+
+..\..\..\..\tools\mhmake\bison.exe -v -d -p "_mesa_program_" --output=program_parse.tab.c program_parse.y
+
+copy "..\..\..\..\tools\mhmake\flex++.exe" flex.exe
+flex.exe --never-interactive --outfile=lex.yy.c program_lexer.l
+del flex.exe
+
+endlocal
+
diff --git a/mesalib/src/mesa/program/hash_table.h b/mesalib/src/mesa/program/hash_table.h index eed2e55dc..6122b1f8a 100644 --- a/mesalib/src/mesa/program/hash_table.h +++ b/mesalib/src/mesa/program/hash_table.h @@ -37,6 +37,7 @@ #include <stdint.h> #include <limits.h> #include <assert.h> +#include <unistd.h> struct string_to_uint_map; |