aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.c8
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.h6
-rw-r--r--mesalib/src/mesa/drivers/SConscript3
-rw-r--r--mesalib/src/mesa/drivers/dri/common/utils.c167
-rw-r--r--mesalib/src/mesa/drivers/dri/common/utils.h2
-rw-r--r--mesalib/src/mesa/drivers/dri/swrast/swrast.c18
-rw-r--r--mesalib/src/mesa/main/accum.c4
-rw-r--r--mesalib/src/mesa/main/config.h2
-rw-r--r--mesalib/src/mesa/main/context.c2
-rw-r--r--mesalib/src/mesa/main/format_unpack.c8
-rw-r--r--mesalib/src/mesa/main/get.c6
-rw-r--r--mesalib/src/mesa/main/mtypes.h12
-rw-r--r--mesalib/src/mesa/main/shared.c2
-rw-r--r--mesalib/src/mesa/main/texstorage.c2
-rw-r--r--mesalib/src/mesa/main/transformfeedback.c6
-rw-r--r--mesalib/src/mesa/program/hash_table.c2
-rw-r--r--mesalib/src/mesa/program/prog_print.c36
-rw-r--r--mesalib/src/mesa/vbo/vbo_attrib_tmp.h4
18 files changed, 123 insertions, 167 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c
index 4d6cdd7a2..f4ac4aa86 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c
@@ -359,6 +359,14 @@ void util_blitter_destroy(struct blitter_context *blitter)
FREE(ctx);
}
+void util_blitter_set_texture_multisample(struct blitter_context *blitter,
+ boolean supported)
+{
+ struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
+
+ ctx->has_texture_multisample = supported;
+}
+
static void blitter_set_running_flag(struct blitter_context_priv *ctx)
{
if (ctx->base.running) {
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.h b/mesalib/src/gallium/auxiliary/util/u_blitter.h
index de0639377..c49faaad7 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.h
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.h
@@ -135,6 +135,12 @@ struct pipe_context *util_blitter_get_pipe(struct blitter_context *blitter)
return blitter->pipe;
}
+/**
+ * Override PIPE_CAP_TEXTURE_MULTISAMPLE as reported by the driver.
+ */
+void util_blitter_set_texture_multisample(struct blitter_context *blitter,
+ boolean supported);
+
/* The default function to draw a rectangle. This can only be used
* inside of the draw_rectangle callback if the driver overrides it. */
void util_blitter_draw_rectangle(struct blitter_context *blitter,
diff --git a/mesalib/src/mesa/drivers/SConscript b/mesalib/src/mesa/drivers/SConscript
index ab0f89432..f1c4da6b8 100644
--- a/mesalib/src/mesa/drivers/SConscript
+++ b/mesalib/src/mesa/drivers/SConscript
@@ -2,5 +2,8 @@ Import('*')
SConscript('osmesa/SConscript')
+if env['x11']:
+ SConscript('x11/SConscript')
+
if env['platform'] == 'windows':
SConscript('windows/gdi/SConscript')
diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c
index 6d8cb4e29..3e99f3d1e 100644
--- a/mesalib/src/mesa/drivers/dri/common/utils.c
+++ b/mesalib/src/mesa/drivers/dri/common/utils.c
@@ -31,6 +31,7 @@
#include <string.h>
#include <stdlib.h>
+#include <stdbool.h>
#include "main/mtypes.h"
#include "main/cpuinfo.h"
#include "main/extensions.h"
@@ -185,143 +186,57 @@ driGetRendererString( char * buffer, const char * hardware_name,
* \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it.
*/
__DRIconfig **
-driCreateConfigs(GLenum fb_format, GLenum fb_type,
+driCreateConfigs(gl_format format,
const uint8_t * depth_bits, const uint8_t * stencil_bits,
unsigned num_depth_stencil_bits,
const GLenum * db_modes, unsigned num_db_modes,
const uint8_t * msaa_samples, unsigned num_msaa_modes,
GLboolean enable_accum)
{
- static const uint8_t bits_table[4][4] = {
- /* R G B A */
- { 3, 3, 2, 0 }, /* Any GL_UNSIGNED_BYTE_3_3_2 */
- { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */
- { 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */
- { 8, 8, 8, 8 } /* Any RGBA with any GL_UNSIGNED_INT_8_8_8_8 */
+ static const uint32_t masks_table[][4] = {
+ /* MESA_FORMAT_RGB565 */
+ { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
+ /* MESA_FORMAT_XRGB8888 */
+ { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
+ /* MESA_FORMAT_ARGB8888 */
+ { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 },
};
- static const uint32_t masks_table_rgb[6][4] = {
- { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 3_3_2 */
- { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 2_3_3_REV */
- { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */
- { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5_REV */
- { 0xFF000000, 0x00FF0000, 0x0000FF00, 0x00000000 }, /* 8_8_8_8 */
- { 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000 } /* 8_8_8_8_REV */
- };
-
- static const uint32_t masks_table_rgba[6][4] = {
- { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 3_3_2 */
- { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 2_3_3_REV */
- { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5 */
- { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5_REV */
- { 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF }, /* 8_8_8_8 */
- { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }, /* 8_8_8_8_REV */
- };
-
- static const uint32_t masks_table_bgr[6][4] = {
- { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 3_3_2 */
- { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 2_3_3_REV */
- { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */
- { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5_REV */
- { 0x0000FF00, 0x00FF0000, 0xFF000000, 0x00000000 }, /* 8_8_8_8 */
- { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 }, /* 8_8_8_8_REV */
- };
-
- static const uint32_t masks_table_bgra[6][4] = {
- { 0x00000007, 0x00000038, 0x000000C0, 0x00000000 }, /* 3_3_2 */
- { 0x000000E0, 0x0000001C, 0x00000003, 0x00000000 }, /* 2_3_3_REV */
- { 0x0000001F, 0x000007E0, 0x0000F800, 0x00000000 }, /* 5_6_5 */
- { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* 5_6_5_REV */
- { 0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF }, /* 8_8_8_8 */
- { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 }, /* 8_8_8_8_REV */
- };
-
- static const uint8_t bytes_per_pixel[6] = {
- 1, /* 3_3_2 */
- 1, /* 2_3_3_REV */
- 2, /* 5_6_5 */
- 2, /* 5_6_5_REV */
- 4, /* 8_8_8_8 */
- 4 /* 8_8_8_8_REV */
- };
-
- const uint8_t * bits;
const uint32_t * masks;
- int index;
__DRIconfig **configs, **c;
struct gl_config *modes;
unsigned i, j, k, h;
unsigned num_modes;
unsigned num_accum_bits = (enable_accum) ? 2 : 1;
-
- switch ( fb_type ) {
- case GL_UNSIGNED_BYTE_3_3_2:
- index = 0;
- break;
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- index = 1;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- index = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- index = 3;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- index = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- index = 5;
- break;
- default:
- fprintf( stderr, "[%s:%u] Unknown framebuffer type 0x%04x.\n",
- __FUNCTION__, __LINE__, fb_type );
- return NULL;
- }
-
-
- /* Valid types are GL_UNSIGNED_SHORT_5_6_5 and GL_UNSIGNED_INT_8_8_8_8 and
- * the _REV versions.
- *
- * Valid formats are GL_RGBA, GL_RGB, and GL_BGRA.
- */
-
- switch ( fb_format ) {
- case GL_RGB:
- masks = masks_table_rgb[ index ];
- break;
-
- case GL_RGBA:
- masks = masks_table_rgba[ index ];
- break;
-
- case GL_BGR:
- masks = masks_table_bgr[ index ];
- break;
-
- case GL_BGRA:
- masks = masks_table_bgra[ index ];
- break;
-
- default:
- fprintf( stderr, "[%s:%u] Unknown framebuffer format 0x%04x.\n",
- __FUNCTION__, __LINE__, fb_format );
- return NULL;
+ int red_bits;
+ int green_bits;
+ int blue_bits;
+ int alpha_bits;
+ bool is_srgb;
+
+ switch (format) {
+ case MESA_FORMAT_RGB565:
+ masks = masks_table[0];
+ break;
+ case MESA_FORMAT_XRGB8888:
+ masks = masks_table[1];
+ break;
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_SARGB8:
+ masks = masks_table[2];
+ break;
+ default:
+ fprintf(stderr, "[%s:%u] Unknown framebuffer type %s (%d).\n",
+ __FUNCTION__, __LINE__,
+ _mesa_get_format_name(format), format);
+ return NULL;
}
- switch ( bytes_per_pixel[ index ] ) {
- case 1:
- bits = bits_table[0];
- break;
- case 2:
- bits = bits_table[1];
- break;
- default:
- bits = ((fb_format == GL_RGB) || (fb_format == GL_BGR))
- ? bits_table[2]
- : bits_table[3];
- break;
- }
+ red_bits = _mesa_get_format_bits(format, GL_RED_BITS);
+ green_bits = _mesa_get_format_bits(format, GL_GREEN_BITS);
+ blue_bits = _mesa_get_format_bits(format, GL_BLUE_BITS);
+ alpha_bits = _mesa_get_format_bits(format, GL_ALPHA_BITS);
+ is_srgb = _mesa_get_format_color_encoding(format) == GL_SRGB;
num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits * num_msaa_modes;
configs = calloc(1, (num_modes + 1) * sizeof *configs);
@@ -338,10 +253,10 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
c++;
memset(modes, 0, sizeof *modes);
- modes->redBits = bits[0];
- modes->greenBits = bits[1];
- modes->blueBits = bits[2];
- modes->alphaBits = bits[3];
+ modes->redBits = red_bits;
+ modes->greenBits = green_bits;
+ modes->blueBits = blue_bits;
+ modes->alphaBits = alpha_bits;
modes->redMask = masks[0];
modes->greenMask = masks[1];
modes->blueMask = masks[2];
@@ -393,7 +308,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
__DRI_ATTRIB_TEXTURE_2D_BIT |
__DRI_ATTRIB_TEXTURE_RECTANGLE_BIT;
- modes->sRGBCapable = GL_FALSE;
+ modes->sRGBCapable = is_srgb;
}
}
}
diff --git a/mesalib/src/mesa/drivers/dri/common/utils.h b/mesalib/src/mesa/drivers/dri/common/utils.h
index 9d6eb3037..e3b3940da 100644
--- a/mesalib/src/mesa/drivers/dri/common/utils.h
+++ b/mesalib/src/mesa/drivers/dri/common/utils.h
@@ -48,7 +48,7 @@ struct __DRIconfigRec {
};
extern __DRIconfig **
-driCreateConfigs(GLenum fb_format, GLenum fb_type,
+driCreateConfigs(gl_format format,
const uint8_t * depth_bits, const uint8_t * stencil_bits,
unsigned num_depth_stencil_bits,
const GLenum * db_modes, unsigned num_db_modes,
diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
index 7596973b0..eeeb81c01 100644
--- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c
+++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
@@ -125,8 +125,7 @@ swrastFillInModes(__DRIscreen *psp,
__DRIconfig **configs;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
+ gl_format format;
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
* support pageflipping at all.
@@ -161,21 +160,14 @@ swrastFillInModes(__DRIscreen *psp,
back_buffer_factor = 2;
switch (pixel_bits) {
- case 8:
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_BYTE_2_3_3_REV;
- break;
case 16:
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
+ format = MESA_FORMAT_RGB565;
break;
case 24:
- fb_format = GL_BGR;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ format = MESA_FORMAT_XRGB8888;
break;
case 32:
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ format = MESA_FORMAT_ARGB8888;
break;
default:
fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__,
@@ -183,7 +175,7 @@ swrastFillInModes(__DRIscreen *psp,
return NULL;
}
- configs = driCreateConfigs(fb_format, fb_type,
+ configs = driCreateConfigs(format,
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
back_buffer_factor, msaa_samples_array, 1,
diff --git a/mesalib/src/mesa/main/accum.c b/mesalib/src/mesa/main/accum.c
index 8b71640df..e2d7726b5 100644
--- a/mesalib/src/mesa/main/accum.c
+++ b/mesalib/src/mesa/main/accum.c
@@ -205,7 +205,7 @@ accum_scale_or_bias(struct gl_context *ctx, GLfloat value,
if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) {
const GLshort incr = (GLshort) (value * 32767.0f);
- GLuint i, j;
+ GLint i, j;
if (bias) {
for (j = 0; j < height; j++) {
GLshort *acc = (GLshort *) accMap;
@@ -283,7 +283,7 @@ accum_or_load(struct gl_context *ctx, GLfloat value,
if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) {
const GLfloat scale = value * 32767.0f;
- GLuint i, j;
+ GLint i, j;
GLfloat (*rgba)[4];
rgba = malloc(width * 4 * sizeof(GLfloat));
diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h
index 1b72b5449..99910d7f3 100644
--- a/mesalib/src/mesa/main/config.h
+++ b/mesalib/src/mesa/main/config.h
@@ -187,7 +187,7 @@
#define MAX_PROGRAM_CALL_DEPTH 8
#define MAX_PROGRAM_TEMPS 256
#define MAX_PROGRAM_ADDRESS_REGS 2
-#define MAX_VARYING 16 /**< number of float[4] vectors */
+#define MAX_VARYING 32 /**< number of float[4] vectors */
#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS
#define MAX_PROGRAM_INPUTS 32
#define MAX_PROGRAM_OUTPUTS 64
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index b00c64233..a51073843 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -614,7 +614,7 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxVarying = MAX_VARYING;
+ ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */
ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
diff --git a/mesalib/src/mesa/main/format_unpack.c b/mesalib/src/mesa/main/format_unpack.c
index 7b46dfc79..04fd1d698 100644
--- a/mesalib/src/mesa/main/format_unpack.c
+++ b/mesalib/src/mesa/main/format_unpack.c
@@ -633,7 +633,7 @@ unpack_Z24_S8(const void *src, GLfloat dst[][4], GLuint n)
for (i = 0; i < n; i++) {
dst[i][0] =
dst[i][1] =
- dst[i][2] = (s[i] >> 8) * scale;
+ dst[i][2] = (GLfloat) ((s[i] >> 8) * scale);
dst[i][3] = 1.0F;
ASSERT(dst[i][0] >= 0.0F);
ASSERT(dst[i][0] <= 1.0F);
@@ -650,7 +650,7 @@ unpack_S8_Z24(const void *src, GLfloat dst[][4], GLuint n)
for (i = 0; i < n; i++) {
dst[i][0] =
dst[i][1] =
- dst[i][2] = (s[i] & 0x00ffffff) * scale;
+ dst[i][2] = (float) ((s[i] & 0x00ffffff) * scale);
dst[i][3] = 1.0F;
ASSERT(dst[i][0] >= 0.0F);
ASSERT(dst[i][0] <= 1.0F);
@@ -2856,7 +2856,7 @@ unpack_float_z_Z24_X8(GLuint n, const void *src, GLfloat *dst)
const GLdouble scale = 1.0 / (GLdouble) 0xffffff;
GLuint i;
for (i = 0; i < n; i++) {
- dst[i] = (s[i] >> 8) * scale;
+ dst[i] = (GLfloat) ((s[i] >> 8) * scale);
ASSERT(dst[i] >= 0.0F);
ASSERT(dst[i] <= 1.0F);
}
@@ -2870,7 +2870,7 @@ unpack_float_z_X8_Z24(GLuint n, const void *src, GLfloat *dst)
const GLdouble scale = 1.0 / (GLdouble) 0xffffff;
GLuint i;
for (i = 0; i < n; i++) {
- dst[i] = (s[i] & 0x00ffffff) * scale;
+ dst[i] = (GLfloat) ((s[i] & 0x00ffffff) * scale);
ASSERT(dst[i] >= 0.0F);
ASSERT(dst[i] <= 1.0F);
}
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index e38d594e2..805f0f978 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -1149,7 +1149,7 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params)
break;
case TYPE_DOUBLEN:
- params[0] = ((GLdouble *) p)[0];
+ params[0] = (GLfloat) (((GLdouble *) p)[0]);
break;
case TYPE_INT_4:
@@ -1170,7 +1170,7 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params)
break;
case TYPE_INT64:
- params[0] = ((GLint64 *) p)[0];
+ params[0] = (GLfloat) (((GLint64 *) p)[0]);
break;
case TYPE_BOOLEAN:
@@ -1449,7 +1449,7 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params)
break;
case TYPE_INT64:
- params[0] = ((GLint64 *) p)[0];
+ params[0] = (GLdouble) (((GLint64 *) p)[0]);
break;
case TYPE_BOOLEAN:
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index c3378cd99..7f2adc773 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -2763,12 +2763,12 @@ struct gl_program_constants
*/
struct gl_constants
{
- GLint MaxTextureMbytes; /**< Max memory per image, in MB */
- GLint MaxTextureLevels; /**< Max mipmap levels. */
- GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */
- GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */
- GLint MaxArrayTextureLayers; /**< Max layers in array textures */
- GLint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */
+ GLuint MaxTextureMbytes; /**< Max memory per image, in MB */
+ GLuint MaxTextureLevels; /**< Max mipmap levels. */
+ GLuint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */
+ GLuint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */
+ GLuint MaxArrayTextureLayers; /**< Max layers in array textures */
+ GLuint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */
GLuint MaxTextureCoordUnits;
GLuint MaxTextureImageUnits;
GLuint MaxVertexTextureImageUnits;
diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c
index fab2995a4..2d2f7bd1d 100644
--- a/mesalib/src/mesa/main/shared.c
+++ b/mesalib/src/mesa/main/shared.c
@@ -89,7 +89,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
/* Create default texture objects */
for (i = 0; i < NUM_TEXTURE_TARGETS; i++) {
/* NOTE: the order of these enums matches the TEXTURE_x_INDEX values */
- static const GLenum targets[NUM_TEXTURE_TARGETS] = {
+ static const GLenum targets[] = {
GL_TEXTURE_BUFFER,
GL_TEXTURE_2D_ARRAY_EXT,
GL_TEXTURE_1D_ARRAY_EXT,
diff --git a/mesalib/src/mesa/main/texstorage.c b/mesalib/src/mesa/main/texstorage.c
index ca02ef301..283aefad3 100644
--- a/mesalib/src/mesa/main/texstorage.c
+++ b/mesalib/src/mesa/main/texstorage.c
@@ -284,7 +284,7 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
}
/* check levels against maximum (note different error than above) */
- if (levels > _mesa_max_texture_levels(ctx, target)) {
+ if (levels > (GLint) _mesa_max_texture_levels(ctx, target)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexStorage%uD(levels too large)", dims);
return GL_TRUE;
diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c
index 0669b3a25..1afc0dccb 100644
--- a/mesalib/src/mesa/main/transformfeedback.c
+++ b/mesalib/src/mesa/main/transformfeedback.c
@@ -277,7 +277,7 @@ _mesa_BeginTransformFeedback(GLenum mode)
{
struct gl_transform_feedback_object *obj;
struct gl_transform_feedback_info *info;
- int i;
+ GLuint i;
GET_CURRENT_CONTEXT(ctx);
obj = ctx->TransformFeedback.CurrentObject;
@@ -537,7 +537,7 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
const GLchar **varyings, GLenum bufferMode)
{
struct gl_shader_program *shProg;
- GLuint i;
+ GLint i;
GET_CURRENT_CONTEXT(ctx);
switch (bufferMode) {
@@ -648,7 +648,7 @@ _mesa_GetTransformFeedbackVarying(GLuint program, GLuint index,
}
linked_xfb_info = &shProg->LinkedTransformFeedback;
- if (index >= linked_xfb_info->NumVarying) {
+ if (index >= (GLuint) linked_xfb_info->NumVarying) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glGetTransformFeedbackVaryings(index=%u)", index);
return;
diff --git a/mesalib/src/mesa/program/hash_table.c b/mesalib/src/mesa/program/hash_table.c
index 7dabadc50..f45ed46af 100644
--- a/mesalib/src/mesa/program/hash_table.c
+++ b/mesalib/src/mesa/program/hash_table.c
@@ -193,7 +193,7 @@ hash_table_call_foreach(struct hash_table *ht,
void *closure),
void *closure)
{
- int bucket;
+ unsigned bucket;
for (bucket = 0; bucket < ht->num_buckets; bucket++) {
struct node *node, *temp;
diff --git a/mesalib/src/mesa/program/prog_print.c b/mesalib/src/mesa/program/prog_print.c
index a83cce4e3..dbaa4d017 100644
--- a/mesalib/src/mesa/program/prog_print.c
+++ b/mesalib/src/mesa/program/prog_print.c
@@ -158,7 +158,23 @@ arb_input_attrib_string(GLint index, GLenum progType)
"fragment.varying[12]",
"fragment.varying[13]",
"fragment.varying[14]",
- "fragment.varying[15]" /* MAX_VARYING = 16 */
+ "fragment.varying[15]",
+ "fragment.varying[16]",
+ "fragment.varying[17]",
+ "fragment.varying[18]",
+ "fragment.varying[19]",
+ "fragment.varying[20]",
+ "fragment.varying[21]",
+ "fragment.varying[22]",
+ "fragment.varying[23]",
+ "fragment.varying[24]",
+ "fragment.varying[25]",
+ "fragment.varying[26]",
+ "fragment.varying[27]",
+ "fragment.varying[28]",
+ "fragment.varying[29]",
+ "fragment.varying[30]",
+ "fragment.varying[31]", /* MAX_VARYING = 32 */
};
/* sanity checks */
@@ -262,7 +278,23 @@ arb_output_attrib_string(GLint index, GLenum progType)
"result.varying[12]",
"result.varying[13]",
"result.varying[14]",
- "result.varying[15]" /* MAX_VARYING = 16 */
+ "result.varying[15]",
+ "result.varying[16]",
+ "result.varying[17]",
+ "result.varying[18]",
+ "result.varying[19]",
+ "result.varying[20]",
+ "result.varying[21]",
+ "result.varying[22]",
+ "result.varying[23]",
+ "result.varying[24]",
+ "result.varying[25]",
+ "result.varying[26]",
+ "result.varying[27]",
+ "result.varying[28]",
+ "result.varying[29]",
+ "result.varying[30]",
+ "result.varying[31]", /* MAX_VARYING = 32 */
};
static const char *const fragResults[] = {
"result.depth", /* FRAG_RESULT_DEPTH */
diff --git a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
index d3fc77eef..884844535 100644
--- a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
@@ -61,12 +61,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
static inline float conv_ui10_to_norm_float(unsigned ui10)
{
- return (float)(ui10) / 1023.0;
+ return ui10 / 1023.0f;
}
static inline float conv_ui2_to_norm_float(unsigned ui2)
{
- return (float)(ui2) / 3.0;
+ return ui2 / 3.0f;
}
#define ATTRUI10_1( A, UI ) ATTR( A, 1, (UI) & 0x3ff, 0, 0, 1 )