summaryrefslogtreecommitdiff
path: root/dist/Mesa/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-06-22 20:04:23 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-06-22 20:04:23 +0000
commit7f992e582712ec939fcc2564ec6138dbaea1154d (patch)
tree26cca762969e35a78b0e7ce8460c43825fd96ff6 /dist/Mesa/src
parentd2bab8f8d2852e84d5cfb626567e2d460239ee04 (diff)
Update to Mesa 7.8.2. Tested by johan@. Thanks.
Diffstat (limited to 'dist/Mesa/src')
-rw-r--r--dist/Mesa/src/gallium/auxiliary/draw/draw_vs_ppc.c2
-rw-r--r--dist/Mesa/src/gallium/auxiliary/rtasm/rtasm_x86sse.c2
-rw-r--r--dist/Mesa/src/gallium/drivers/cell/ppu/cell_context.c2
-rw-r--r--dist/Mesa/src/gallium/drivers/cell/ppu/cell_fence.c1
-rw-r--r--dist/Mesa/src/gallium/drivers/cell/ppu/cell_pipe_state.c2
-rw-r--r--dist/Mesa/src/glx/glxext.c4
-rw-r--r--dist/Mesa/src/mesa/drivers/common/meta.c23
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c4
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c4
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/i965/brw_clip_tri.c20
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/i965/brw_draw_upload.c2
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h2
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c5
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h1
-rw-r--r--dist/Mesa/src/mesa/drivers/dri/intel/intel_tex_format.c14
-rw-r--r--dist/Mesa/src/mesa/drivers/osmesa/Makefile6
-rw-r--r--dist/Mesa/src/mesa/main/fbobject.c6
-rw-r--r--dist/Mesa/src/mesa/main/version.h4
-rw-r--r--dist/Mesa/src/mesa/shader/shader_api.c79
-rw-r--r--dist/Mesa/src/mesa/state_tracker/st_mesa_to_tgsi.c2
20 files changed, 130 insertions, 55 deletions
diff --git a/dist/Mesa/src/gallium/auxiliary/draw/draw_vs_ppc.c b/dist/Mesa/src/gallium/auxiliary/draw/draw_vs_ppc.c
index d869eecec..c01082dea 100644
--- a/dist/Mesa/src/gallium/auxiliary/draw/draw_vs_ppc.c
+++ b/dist/Mesa/src/gallium/auxiliary/draw/draw_vs_ppc.c
@@ -125,7 +125,7 @@ vs_ppc_run_linear( struct draw_vertex_shader *base,
*/
shader->func(inputs_soa, outputs_soa, temps_soa,
(float (*)[4]) shader->base.immediates,
- (const float (*)[4])constants[0],
+ (float (*)[4]) constants[0],
ppc_builtin_constants);
/* convert (up to) four output verts from SoA back to AoS format */
diff --git a/dist/Mesa/src/gallium/auxiliary/rtasm/rtasm_x86sse.c b/dist/Mesa/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
index f675427d9..a5ff5367a 100644
--- a/dist/Mesa/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
+++ b/dist/Mesa/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
@@ -1757,6 +1757,8 @@ void (*x86_get_func( struct x86_function *p ))(void)
#else
+void x86sse_dummy( void );
+
void x86sse_dummy( void )
{
}
diff --git a/dist/Mesa/src/gallium/drivers/cell/ppu/cell_context.c b/dist/Mesa/src/gallium/drivers/cell/ppu/cell_context.c
index 5bff9869f..b48393511 100644
--- a/dist/Mesa/src/gallium/drivers/cell/ppu/cell_context.c
+++ b/dist/Mesa/src/gallium/drivers/cell/ppu/cell_context.c
@@ -74,7 +74,7 @@ cell_destroy_context( struct pipe_context *pipe )
static struct draw_context *
cell_draw_create(struct cell_context *cell)
{
- struct draw_context *draw = draw_create();
+ struct draw_context *draw = draw_create(&cell->pipe);
#if 0 /* broken */
if (getenv("GALLIUM_CELL_VS")) {
diff --git a/dist/Mesa/src/gallium/drivers/cell/ppu/cell_fence.c b/dist/Mesa/src/gallium/drivers/cell/ppu/cell_fence.c
index e10071529..6ff19f270 100644
--- a/dist/Mesa/src/gallium/drivers/cell/ppu/cell_fence.c
+++ b/dist/Mesa/src/gallium/drivers/cell/ppu/cell_fence.c
@@ -92,7 +92,6 @@ cell_add_buffer_to_list(struct cell_context *cell,
struct cell_buffer_list *list,
struct pipe_buffer *buffer)
{
- struct pipe_screen *ps = cell->pipe.screen;
struct cell_buffer_node *node = CALLOC_STRUCT(cell_buffer_node);
/* create new list node which references the buffer, insert at head */
if (node) {
diff --git a/dist/Mesa/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/dist/Mesa/src/gallium/drivers/cell/ppu/cell_pipe_state.c
index 3d8b4409c..74a73b418 100644
--- a/dist/Mesa/src/gallium/drivers/cell/ppu/cell_pipe_state.c
+++ b/dist/Mesa/src/gallium/drivers/cell/ppu/cell_pipe_state.c
@@ -197,7 +197,7 @@ cell_bind_rasterizer_state(struct pipe_context *pipe, void *rast)
struct cell_context *cell = cell_context(pipe);
/* pass-through to draw module */
- draw_set_rasterizer_state(cell->draw, rasterizer);
+ draw_set_rasterizer_state(cell->draw, rasterizer, rast);
cell->rasterizer = rasterizer;
diff --git a/dist/Mesa/src/glx/glxext.c b/dist/Mesa/src/glx/glxext.c
index 82d3a56f3..79285ec71 100644
--- a/dist/Mesa/src/glx/glxext.c
+++ b/dist/Mesa/src/glx/glxext.c
@@ -584,6 +584,10 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count,
config->yInverted = *bp++;
break;
#endif
+ case GLX_USE_GL:
+ if (fbconfig_style_tags)
+ bp++;
+ break;
case None:
i = count;
break;
diff --git a/dist/Mesa/src/mesa/drivers/common/meta.c b/dist/Mesa/src/mesa/drivers/common/meta.c
index 3d2183c61..89ca476f9 100644
--- a/dist/Mesa/src/mesa/drivers/common/meta.c
+++ b/dist/Mesa/src/mesa/drivers/common/meta.c
@@ -813,6 +813,21 @@ _mesa_meta_end(GLcontext *ctx)
/**
+ * Convert Z from a normalized value in the range [0, 1] to an object-space
+ * Z coordinate in [-1, +1] so that drawing at the new Z position with the
+ * default/identity ortho projection results in the original Z value.
+ * Used by the meta-Clear, Draw/CopyPixels and Bitmap functions where the Z
+ * value comes from the clear value or raster position.
+ */
+static INLINE GLfloat
+invert_z(GLfloat normZ)
+{
+ GLfloat objZ = 1.0 - 2.0 * normZ;
+ return objZ;
+}
+
+
+/**
* One-time init for a temp_texture object.
* Choose tex target, compute max tex size, etc.
*/
@@ -1433,7 +1448,7 @@ _mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers)
const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin;
const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax;
const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax;
- const GLfloat z = 1.0 - 2.0 * ctx->Depth.Clear;
+ const GLfloat z = invert_z(ctx->Depth.Clear);
GLuint i;
verts[0].x = x0;
@@ -1539,7 +1554,7 @@ _mesa_meta_CopyPixels(GLcontext *ctx, GLint srcX, GLint srcY,
const GLfloat dstY0 = (GLfloat) dstY;
const GLfloat dstX1 = dstX + width * ctx->Pixel.ZoomX;
const GLfloat dstY1 = dstY + height * ctx->Pixel.ZoomY;
- const GLfloat z = ctx->Current.RasterPos[2];
+ const GLfloat z = invert_z(ctx->Current.RasterPos[2]);
verts[0].x = dstX0;
verts[0].y = dstY0;
@@ -1828,7 +1843,7 @@ _mesa_meta_DrawPixels(GLcontext *ctx,
const GLfloat y0 = (GLfloat) y;
const GLfloat x1 = x + width * ctx->Pixel.ZoomX;
const GLfloat y1 = y + height * ctx->Pixel.ZoomY;
- const GLfloat z = ctx->Current.RasterPos[2];
+ const GLfloat z = invert_z(ctx->Current.RasterPos[2]);
verts[0].x = x0;
verts[0].y = y0;
@@ -2031,7 +2046,7 @@ _mesa_meta_Bitmap(GLcontext *ctx,
const GLfloat y0 = (GLfloat) y;
const GLfloat x1 = (GLfloat) (x + width);
const GLfloat y1 = (GLfloat) (y + height);
- const GLfloat z = ctx->Current.RasterPos[2];
+ const GLfloat z = invert_z(ctx->Current.RasterPos[2]);
GLuint i;
verts[0].x = x0;
diff --git a/dist/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c b/dist/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c
index a1ab8f8b6..815074c2c 100644
--- a/dist/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/dist/Mesa/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -281,6 +281,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
GLenum ws = tObj->WrapS;
GLenum wt = tObj->WrapT;
GLenum wr = tObj->WrapR;
+ float minlod;
/* We program 1D textures as 2D textures, so the 2D texcoord could
* result in sampling border values if we don't set the T wrap to
@@ -321,8 +322,9 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
(translate_wrap_mode(wt) << SS3_TCY_ADDR_MODE_SHIFT) |
(translate_wrap_mode(wr) << SS3_TCZ_ADDR_MODE_SHIFT));
+ minlod = MIN2(tObj->MinLod, tObj->_MaxLevel - tObj->BaseLevel);
state[I915_TEXREG_SS3] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT);
- state[I915_TEXREG_SS3] |= (U_FIXED(CLAMP(tObj->MinLod, 0.0, 11.0), 4) <<
+ state[I915_TEXREG_SS3] |= (U_FIXED(CLAMP(minlod, 0.0, 11.0), 4) <<
SS3_MIN_LOD_SHIFT);
}
diff --git a/dist/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c b/dist/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c
index 0a93e64b1..b7e38bd6b 100644
--- a/dist/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/dist/Mesa/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -627,8 +627,8 @@ i915_set_draw_region(struct intel_context *intel,
state->Buffer[I915_DESTREG_DRAWRECT2] = 0;
state->Buffer[I915_DESTREG_DRAWRECT3] = (draw_y << 16) | draw_x;
state->Buffer[I915_DESTREG_DRAWRECT4] =
- ((ctx->DrawBuffer->Width + draw_x) & 0xffff) |
- ((ctx->DrawBuffer->Height + draw_y) << 16);
+ ((ctx->DrawBuffer->Width + draw_x - 1) & 0xffff) |
+ ((ctx->DrawBuffer->Height + draw_y - 1) << 16);
state->Buffer[I915_DESTREG_DRAWRECT5] = (draw_y << 16) | draw_x;
I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS);
diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_clip_tri.c b/dist/Mesa/src/mesa/drivers/dri/i965/brw_clip_tri.c
index b27fe654c..916a99ea0 100644
--- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_clip_tri.c
+++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_clip_tri.c
@@ -177,7 +177,7 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c )
void brw_clip_tri_flat_shade( struct brw_clip_compile *c )
{
struct brw_compile *p = &c->func;
- struct brw_instruction *is_poly;
+ struct brw_instruction *is_poly, *is_trifan;
struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */
brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK));
@@ -195,8 +195,22 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c )
is_poly = brw_ELSE(p, is_poly);
{
if (c->key.pv_first) {
- brw_clip_copy_colors(c, 1, 0);
- brw_clip_copy_colors(c, 2, 0);
+ brw_CMP(p,
+ vec1(brw_null_reg()),
+ BRW_CONDITIONAL_EQ,
+ tmp0,
+ brw_imm_ud(_3DPRIM_TRIFAN));
+ is_trifan = brw_IF(p, BRW_EXECUTE_1);
+ {
+ brw_clip_copy_colors(c, 0, 1);
+ brw_clip_copy_colors(c, 2, 1);
+ }
+ is_trifan = brw_ELSE(p, is_trifan);
+ {
+ brw_clip_copy_colors(c, 1, 0);
+ brw_clip_copy_colors(c, 2, 0);
+ }
+ brw_ENDIF(p, is_trifan);
}
else {
brw_clip_copy_colors(c, 0, 2);
diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_draw_upload.c b/dist/Mesa/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 8247faa36..9cbff2486 100644
--- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -59,7 +59,7 @@ static GLuint half_float_types[5] = {
0,
BRW_SURFACEFORMAT_R16_FLOAT,
BRW_SURFACEFORMAT_R16G16_FLOAT,
- 0, /* can't seem to render this one */
+ BRW_SURFACEFORMAT_R16G16B16A16_FLOAT,
BRW_SURFACEFORMAT_R16G16B16A16_FLOAT
};
diff --git a/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h b/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h
index 47b764d24..ddd1f909c 100644
--- a/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h
+++ b/dist/Mesa/src/mesa/drivers/dri/i965/brw_wm.h
@@ -67,7 +67,7 @@ struct brw_wm_prog_key {
GLuint flat_shade:1;
GLuint linear_color:1; /**< linear interpolation vs perspective interp */
GLuint runtime_check_aads_emit:1;
- GLuint nr_color_regions:2;
+ GLuint nr_color_regions:5;
GLbitfield proj_attrib_mask; /**< one bit per fragment program attribute */
GLuint shadowtex_mask:16;
diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c
index 66bee9e04..52e127f9a 100644
--- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c
+++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.c
@@ -610,6 +610,7 @@ intelInitContext(struct intel_context *intel,
intel->driContext = driContextPriv;
intel->driFd = sPriv->fd;
+ intel->has_xrgb_textures = GL_TRUE;
if (IS_GEN6(intel->intelScreen->deviceID)) {
intel->gen = 6;
intel->needs_ff_sync = GL_TRUE;
@@ -631,6 +632,10 @@ intelInitContext(struct intel_context *intel,
}
} else {
intel->gen = 2;
+ if (intel->intelScreen->deviceID == PCI_CHIP_I830_M ||
+ intel->intelScreen->deviceID == PCI_CHIP_845_G) {
+ intel->has_xrgb_textures = GL_FALSE;
+ }
}
driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h
index 1a24bf6cc..0684feedd 100644
--- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h
+++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_context.h
@@ -145,6 +145,7 @@ struct intel_context
GLboolean is_g4x;
GLboolean is_945;
GLboolean has_luminance_srgb;
+ GLboolean has_xrgb_textures;
int urb_size;
diff --git a/dist/Mesa/src/mesa/drivers/dri/intel/intel_tex_format.c b/dist/Mesa/src/mesa/drivers/dri/intel/intel_tex_format.c
index 7be5231ea..c23424d56 100644
--- a/dist/Mesa/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/dist/Mesa/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -49,7 +49,14 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) {
return MESA_FORMAT_RGB565;
}
- return do32bpt ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_RGB565;
+ if (do32bpt) {
+ if (intel->has_xrgb_textures)
+ return MESA_FORMAT_XRGB8888;
+ else
+ return MESA_FORMAT_ARGB8888;
+ } else {
+ return MESA_FORMAT_RGB565;
+ }
case GL_RGBA8:
case GL_RGB10_A2:
@@ -68,7 +75,10 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return MESA_FORMAT_XRGB8888;
+ if (intel->has_xrgb_textures)
+ return MESA_FORMAT_XRGB8888;
+ else
+ return MESA_FORMAT_ARGB8888;
case GL_RGB5:
case GL_RGB4:
diff --git a/dist/Mesa/src/mesa/drivers/osmesa/Makefile b/dist/Mesa/src/mesa/drivers/osmesa/Makefile
index 9010bbd13..951702ee8 100644
--- a/dist/Mesa/src/mesa/drivers/osmesa/Makefile
+++ b/dist/Mesa/src/mesa/drivers/osmesa/Makefile
@@ -19,17 +19,11 @@ INCLUDE_DIRS = \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main
-# Standalone osmesa needs to be linked with core Mesa APIs
-ifeq ($(DRIVER_DIRS), osmesa)
CORE_MESA = \
$(TOP)/src/mesa/libmesa.a \
$(TOP)/src/mesa/libglapi.a \
$(TOP)/src/glsl/cl/libglslcl.a \
$(TOP)/src/glsl/pp/libglslpp.a
-else
-CORE_MESA =
-endif
-
.c.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
diff --git a/dist/Mesa/src/mesa/main/fbobject.c b/dist/Mesa/src/mesa/main/fbobject.c
index 14c533e0d..cc20f7479 100644
--- a/dist/Mesa/src/mesa/main/fbobject.c
+++ b/dist/Mesa/src/mesa/main/fbobject.c
@@ -1766,10 +1766,10 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
rb = NULL;
}
- if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT &&
+ rb && rb->Format != MESA_FORMAT_NONE) {
/* make sure the renderbuffer is a depth/stencil format */
- const GLenum baseFormat =
- _mesa_get_format_base_format(att->Renderbuffer->Format);
+ const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
if (baseFormat != GL_DEPTH_STENCIL) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glFramebufferRenderbufferEXT(renderbuffer"
diff --git a/dist/Mesa/src/mesa/main/version.h b/dist/Mesa/src/mesa/main/version.h
index cd760beba..9955be24a 100644
--- a/dist/Mesa/src/mesa/main/version.h
+++ b/dist/Mesa/src/mesa/main/version.h
@@ -34,8 +34,8 @@
/* Mesa version */
#define MESA_MAJOR 7
#define MESA_MINOR 8
-#define MESA_PATCH 1
-#define MESA_VERSION_STRING "7.8.1"
+#define MESA_PATCH 2
+#define MESA_VERSION_STRING "7.8.2"
/* To make version comparison easy */
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/dist/Mesa/src/mesa/shader/shader_api.c b/dist/Mesa/src/mesa/shader/shader_api.c
index 940fe2d03..5e87bb405 100644
--- a/dist/Mesa/src/mesa/shader/shader_api.c
+++ b/dist/Mesa/src/mesa/shader/shader_api.c
@@ -1260,6 +1260,54 @@ lookup_uniform_parameter(GLcontext *ctx, GLuint program, GLint location,
/**
+ * GLGL uniform arrays and structs require special handling.
+ *
+ * The GL_ARB_shader_objects spec says that if you use
+ * glGetUniformLocation to get the location of an array, you CANNOT
+ * access other elements of the array by adding an offset to the
+ * returned location. For example, you must call
+ * glGetUniformLocation("foo[16]") if you want to set the 16th element
+ * of the array with glUniform().
+ *
+ * HOWEVER, some other OpenGL drivers allow accessing array elements
+ * by adding an offset to the returned array location. And some apps
+ * seem to depend on that behaviour.
+ *
+ * Mesa's gl_uniform_list doesn't directly support this since each
+ * entry in the list describes one uniform variable, not one uniform
+ * element. We could insert dummy entries in the list for each array
+ * element after [0] but that causes complications elsewhere.
+ *
+ * We solve this problem by encoding two values in the location that's
+ * returned by glGetUniformLocation():
+ * a) index into gl_uniform_list::Uniforms[] for the uniform
+ * b) an array/field offset (0 for simple types)
+ *
+ * These two values are encoded in the high and low halves of a GLint.
+ * By putting the uniform number in the high part and the offset in the
+ * low part, we can support the unofficial ability to index into arrays
+ * by adding offsets to the location value.
+ */
+static void
+merge_location_offset(GLint *location, GLint offset)
+{
+ *location = (*location << 16) | offset;
+}
+
+
+/**
+ * Seperate the uniform location and parameter offset. See above.
+ */
+static void
+split_location_offset(GLint *location, GLint *offset)
+{
+ *offset = *location & 0xffff;
+ *location = *location >> 16;
+}
+
+
+
+/**
* Called via ctx->Driver.GetUniformfv().
*/
static void
@@ -1268,6 +1316,9 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
{
struct gl_program *prog;
GLint paramPos;
+ GLint offset;
+
+ split_location_offset(&location, &offset);
lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
@@ -1298,7 +1349,10 @@ _mesa_get_uniformiv(GLcontext *ctx, GLuint program, GLint location,
{
struct gl_program *prog;
GLint paramPos;
+ GLint offset;
+ split_location_offset(&location, &offset);
+
lookup_uniform_parameter(ctx, program, location, &prog, &paramPos);
if (prog) {
@@ -1319,31 +1373,6 @@ _mesa_get_uniformiv(GLcontext *ctx, GLuint program, GLint location,
/**
- * The value returned by GetUniformLocation actually encodes two things:
- * 1. the index into the prog->Uniforms[] array for the uniform
- * 2. an offset in the prog->ParameterValues[] array for specifying array
- * elements or structure fields.
- * This function merges those two values.
- */
-static void
-merge_location_offset(GLint *location, GLint offset)
-{
- *location = *location | (offset << 16);
-}
-
-
-/**
- * Seperate the uniform location and parameter offset. See above.
- */
-static void
-split_location_offset(GLint *location, GLint *offset)
-{
- *offset = (*location >> 16);
- *location = *location & 0xffff;
-}
-
-
-/**
* Called via ctx->Driver.GetUniformLocation().
*
* The return value will encode two values, the uniform location and an
diff --git a/dist/Mesa/src/mesa/state_tracker/st_mesa_to_tgsi.c b/dist/Mesa/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 807d21a71..d7ef57e2d 100644
--- a/dist/Mesa/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/dist/Mesa/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -154,7 +154,7 @@ dst_register( struct st_translate *t,
return t->temps[index];
case PROGRAM_OUTPUT:
- if (index == t->psizoutindex)
+ if (index == VERT_RESULT_PSIZ)
t->prevInstWrotePsiz = GL_TRUE;
return t->outputs[t->outputMapping[index]];