Mesa (master): st/dri: Install ARB_vertex_array_object functions

2009-10-03 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: ebbd65eb0658adcb797e0788a3472a7b69b3bfc2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ebbd65eb0658adcb797e0788a3472a7b69b3bfc2

Author: Nicolai Hähnle nhaeh...@gmail.com
Date:   Sat Oct  3 02:11:02 2009 +0200

st/dri: Install ARB_vertex_array_object functions

Signed-off-by: Nicolai Hähnle nhaeh...@gmail.com

---

 src/gallium/state_trackers/dri/dri_extensions.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri_extensions.c 
b/src/gallium/state_trackers/dri/dri_extensions.c
index 4349a4d..8c5cef6 100644
--- a/src/gallium/state_trackers/dri/dri_extensions.c
+++ b/src/gallium/state_trackers/dri/dri_extensions.c
@@ -39,6 +39,7 @@
 #define need_GL_ARB_point_parameters
 #define need_GL_ARB_shader_objects
 #define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_array_object
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_ARB_vertex_program
 #define need_GL_ARB_vertex_shader
@@ -79,6 +80,7 @@ const struct dri_extension card_extensions[] = {
{GL_ARB_texture_env_dot3, NULL},
{GL_ARB_texture_mirrored_repeat, NULL},
{GL_ARB_texture_rectangle, NULL},
+   {GL_ARB_vertex_array_object, GL_ARB_vertex_array_object_functions},
{GL_ARB_vertex_buffer_object, GL_ARB_vertex_buffer_object_functions},
{GL_ARB_vertex_shader, GL_ARB_vertex_shader_functions},
{GL_ARB_vertex_program, GL_ARB_vertex_program_functions},

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Reset vbo_offset after allocation of a new buffer

2009-10-03 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: 751aa58e01bd2b4f35aa0e1477d77a0dc5490f39
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=751aa58e01bd2b4f35aa0e1477d77a0dc5490f39

Author: Nicolai Hähnle nhaeh...@gmail.com
Date:   Sat Oct  3 17:24:04 2009 +0200

r300g: Reset vbo_offset after allocation of a new buffer

This fixes the glxgears bug, among other things.

Signed-off-by: Nicolai Hähnle nhaeh...@gmail.com

---

 src/gallium/drivers/r300/r300_render.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index 16f6404..69d1623 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -79,13 +79,14 @@ static boolean r300_render_allocate_vertices(struct 
vbuf_render* render,
 struct pipe_screen* screen = r300-context.screen;
 size_t size = (size_t)vertex_size * (size_t)count;
 
-if (size + r300render-vbo_offset  r300render-vbo_size) 
+if (size + r300render-vbo_offset  r300render-vbo_size)
 {
 pipe_buffer_reference(r300-vbo, NULL);
 r300render-vbo = pipe_buffer_create(screen,
  64,
  PIPE_BUFFER_USAGE_VERTEX,
  R300_MAX_VBO_SIZE);
+r300render-vbo_offset = 0;
 r300render-vbo_size = R300_MAX_VBO_SIZE;
 }
 
@@ -118,7 +119,7 @@ static void r300_render_unmap_vertices(struct vbuf_render* 
render,
 OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, max);
 END_CS;
 
-r300render-vbo_max_used = MAX2(r300render-vbo_max_used, 
+r300render-vbo_max_used = MAX2(r300render-vbo_max_used,
 r300render-vertex_size * (max + 1));
 pipe_buffer_unmap(screen, r300render-vbo);
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): st/dri: Install APPLE_vertex_array_object functions

2009-10-03 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: fce2095a90440d1c129583fb8b6c26a93d4bde13
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fce2095a90440d1c129583fb8b6c26a93d4bde13

Author: Nicolai Hähnle nhaeh...@gmail.com
Date:   Sat Oct  3 17:39:32 2009 +0200

st/dri: Install APPLE_vertex_array_object functions

Besides from being necessary to use that extension, it also fixes a crash
when deleting the currently bound vertex array object.

Signed-off-by: Nicolai Hähnle nhaeh...@gmail.com

---

 src/gallium/state_trackers/dri/dri_extensions.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri_extensions.c 
b/src/gallium/state_trackers/dri/dri_extensions.c
index 8c5cef6..f39a305 100644
--- a/src/gallium/state_trackers/dri/dri_extensions.c
+++ b/src/gallium/state_trackers/dri/dri_extensions.c
@@ -53,6 +53,7 @@
 #define need_GL_EXT_framebuffer_object
 #define need_GL_EXT_multi_draw_arrays
 #define need_GL_EXT_secondary_color
+#define need_GL_APPLE_vertex_array_object
 #define need_GL_NV_vertex_program
 #define need_GL_VERSION_2_0
 #define need_GL_VERSION_2_1
@@ -105,6 +106,7 @@ const struct dri_extension card_extensions[] = {
{GL_EXT_texture_lod_bias, NULL},
{GL_3DFX_texture_compression_FXT1, NULL},
{GL_APPLE_client_storage, NULL},
+   {GL_APPLE_vertex_array_object, GL_APPLE_vertex_array_object_functions},
{GL_MESA_pack_invert, NULL},
{GL_MESA_ycbcr_texture, NULL},
{GL_NV_blend_square, NULL},

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Remove an unnecessarily created pipe buffer ( and thus fix a leak)

2009-10-03 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: 26df8af4fe4173eb52132dc63ee789b80a7a4db2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=26df8af4fe4173eb52132dc63ee789b80a7a4db2

Author: Nicolai Hähnle nhaeh...@gmail.com
Date:   Sat Oct  3 17:49:16 2009 +0200

r300g: Remove an unnecessarily created pipe buffer (and thus fix a leak)

Signed-off-by: Nicolai Hähnle nhaeh...@gmail.com

---

 src/gallium/drivers/r300/r300_render.c |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index 69d1623..ca44e0f 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -223,13 +223,6 @@ static void r300_render_draw(struct vbuf_render* render,
 
 r300_prepare_render(r300render, count);
 
-/* Send our indices into an index buffer. */
-index_buffer = pipe_buffer_create(screen, 64, PIPE_BUFFER_USAGE_VERTEX,
-  count * 2);
-if (!index_buffer) {
-return;
-}
-
 BEGIN_CS(2 + (count+1)/2);
 OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, (count+1)/2);
 OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count  16) |

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): meta: Make sure texImage-TexFormat is valid for CopyTex(Sub )Image.

2009-10-03 Thread Michel Dänzer
Module: Mesa
Branch: master
Commit: 4a6759b7789dc703a8ee9f1cf08af22c6e8101fb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a6759b7789dc703a8ee9f1cf08af22c6e8101fb

Author: Michel Dänzer daen...@vmware.com
Date:   Sat Oct  3 18:01:57 2009 +0200

meta: Make sure texImage-TexFormat is valid for CopyTex(Sub)Image.

---

 src/mesa/drivers/common/meta.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 12e0bdd..e173224 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -55,6 +55,7 @@
 #include main/stencil.h
 #include main/texobj.h
 #include main/texenv.h
+#include main/texformat.h
 #include main/teximage.h
 #include main/texparam.h
 #include main/texstate.h
@@ -2471,6 +2472,12 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum 
target, GLint level,
   return;
}
 
+   if (texImage-TexFormat == _mesa_null_texformat)
+   texImage-TexFormat = ctx-Driver.ChooseTextureFormat(ctx,
+ internalFormat,
+ format,
+ type);
+
_mesa_unlock_texture(ctx, texObj); /* need to unlock first */
 
/*

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): radeon: Cope better with texture images with no miptrees.

2009-10-03 Thread Michel Dänzer
Module: Mesa
Branch: master
Commit: b330cebe01c5574e203fa6b9d49fee4c01e1adb6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b330cebe01c5574e203fa6b9d49fee4c01e1adb6

Author: Michel Dänzer daen...@vmware.com
Date:   Sat Oct  3 18:01:58 2009 +0200

radeon: Cope better with texture images with no miptrees.

Fixes crash with compiz magnifier plugin.

---

 src/mesa/drivers/dri/radeon/radeon_texture.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c 
b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 049284e..7b7392b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -101,7 +101,12 @@ void radeonFreeTexImageData(GLcontext *ctx, struct 
gl_texture_image *timage)
 /* Set Data pointer and additional data for mapped texture image */
 static void teximage_set_map_data(radeon_texture_image *image)
 {
-   radeon_mipmap_level *lvl = image-mt-levels[image-mtlevel];
+   radeon_mipmap_level *lvl;
+
+   if (!image-mt)
+   return;
+
+   lvl = image-mt-levels[image-mtlevel];
 
image-base.Data = image-mt-bo-ptr + 
lvl-faces[image-mtface].offset;
image-base.RowStride = lvl-rowstride / image-mt-bpp;
@@ -969,7 +974,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct 
gl_texture_object *t
radeon_texture_image *image = 
get_radeon_texture_image(texObj-Image[face][level]);
if (RADEON_DEBUG  RADEON_TEXTURE)
fprintf(stderr,  face %i, level %i... %p vs %p 
, face, level, t-mt, image-mt);
-   if (t-mt == image-mt) {
+   if (t-mt == image-mt || (!image-mt  
!image-base.Data)) {
if (RADEON_DEBUG  RADEON_TEXTURE)
fprintf(stderr, OK\n);
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Build in the trace and softpipe driver for xorg state tracker

2009-10-03 Thread Michel Dänzer
Module: Mesa
Branch: master
Commit: aa6aa77a1be91022933975dbccf8f2aabc584baa
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa6aa77a1be91022933975dbccf8f2aabc584baa

Author: Sedat Dilek sedat.di...@gmail.com
Date:   Sat Oct  3 18:01:58 2009 +0200

r300g: Build in the trace and softpipe driver for xorg state tracker

Same as in src/gallium/winsys/drm/intel/xorg/Makefile

Thanks MrCooper for explanations on IRC

[ Summary amended by Michel Dänzer to clarify that this is related to the xorg
  state tracker ]

---

 src/gallium/winsys/drm/radeon/xorg/Makefile |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/winsys/drm/radeon/xorg/Makefile 
b/src/gallium/winsys/drm/radeon/xorg/Makefile
index 0241625..9fa16da 100644
--- a/src/gallium/winsys/drm/radeon/xorg/Makefile
+++ b/src/gallium/winsys/drm/radeon/xorg/Makefile
@@ -20,6 +20,8 @@ LIBS = \
$(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a \
$(GALLIUMDIR)/winsys/drm/radeon/core/libradeonwinsys.a \
$(TOP)/src/gallium/drivers/r300/libr300.a \
+   $(TOP)/src/gallium/drivers/trace/libtrace.a \
+   $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
$(GALLIUM_AUXILIARIES)
 
 #

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Fix memory leak in radeon_texture_from_shared_handle

2009-10-03 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: 59b20b760d63dad15d4d62a43bae8b7e26085c79
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=59b20b760d63dad15d4d62a43bae8b7e26085c79

Author: Nicolai Hähnle nhaeh...@gmail.com
Date:   Sat Oct  3 17:56:51 2009 +0200

r300g: Fix memory leak in radeon_texture_from_shared_handle

Signed-off-by: Nicolai Hähnle nhaeh...@gmail.com

---

 src/gallium/winsys/drm/radeon/core/radeon_drm.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c 
b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
index a4011db..caab33d 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
@@ -107,13 +107,18 @@ radeon_texture_from_shared_handle(struct drm_api *api,
   unsigned handle)
 {
 struct pipe_buffer *buffer;
+struct pipe_texture *blanket;
 
 buffer = radeon_buffer_from_handle(api, screen, name, handle);
 if (!buffer) {
 return NULL;
 }
 
-return screen-texture_blanket(screen, templ, stride, buffer);
+blanket = screen-texture_blanket(screen, templ, stride, buffer);
+
+pipe_buffer_reference(buffer, NULL);
+
+return blanket;
 }
 
 static boolean radeon_shared_handle_from_texture(struct drm_api *api,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r300g: Do not abort on fragment program compiler error

2009-10-03 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: 81e5188f66248424d54fcf1d85a81510694bd472
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=81e5188f66248424d54fcf1d85a81510694bd472

Author: Nicolai Hähnle nhaeh...@gmail.com
Date:   Sat Oct  3 19:20:31 2009 +0200

r300g: Do not abort on fragment program compiler error

Signed-off-by: Nicolai Hähnle nhaeh...@gmail.com

---

 src/gallium/drivers/r300/r300_fs.c |   11 ---
 src/gallium/drivers/r300/r300_fs.h |2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_fs.c 
b/src/gallium/drivers/r300/r300_fs.c
index a0e848a..546ad54 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -126,9 +126,14 @@ void r300_translate_fragment_shader(struct r300_context* 
r300,
 /* Invoke the compiler */
 r3xx_compile_fragment_program(compiler);
 if (compiler.Base.Error) {
-/* Todo: Fail gracefully */
-fprintf(stderr, r300 FP: Compiler error\n);
-abort();
+/* Todo: Fallback to software rendering gracefully? */
+fprintf(stderr, r300 FP: Compiler error: %s\n, 
compiler.Base.ErrorMsg);
+
+if (compiler.is_r500) {
+memcpy(compiler.code, r5xx_passthrough_fragment_shader, 
sizeof(r5xx_passthrough_fragment_shader));
+} else {
+memcpy(compiler.code, r3xx_passthrough_fragment_shader, 
sizeof(r3xx_passthrough_fragment_shader));
+}
 }
 
 /* And, finally... */
diff --git a/src/gallium/drivers/r300/r300_fs.h 
b/src/gallium/drivers/r300/r300_fs.h
index 9fab789..967e9f6 100644
--- a/src/gallium/drivers/r300/r300_fs.h
+++ b/src/gallium/drivers/r300/r300_fs.h
@@ -48,4 +48,4 @@ struct r300_fragment_shader {
 void r300_translate_fragment_shader(struct r300_context* r300,
 struct r300_fragment_shader* fs);
 
-#endif /* R300_FS_H */
+#endif /* R300_FS_H */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): prog_parameter: Document the fact that Size may be 4

2009-10-03 Thread Nicolai Hähnle
Module: Mesa
Branch: master
Commit: 7d2699aedc084d9cb9c2bd2f8bdb5f038271ac1e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d2699aedc084d9cb9c2bd2f8bdb5f038271ac1e

Author: Nicolai Hähnle nhaeh...@gmail.com
Date:   Sat Oct  3 16:18:57 2009 +0200

prog_parameter: Document the fact that Size may be  4

Signed-off-by: Nicolai Hähnle nhaeh...@gmail.com

---

 src/mesa/shader/prog_parameter.h |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h
index d1fcf47..699cb0c 100644
--- a/src/mesa/shader/prog_parameter.h
+++ b/src/mesa/shader/prog_parameter.h
@@ -56,7 +56,13 @@ struct gl_program_parameter
const char *Name;/** Null-terminated string */
gl_register_file Type;   /** PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */
GLenum DataType; /** GL_FLOAT, GL_FLOAT_VEC2, etc */
-   GLuint Size; /** Number of components (1..4) */
+   /**
+* Number of components (1..4), or more.
+* If the number of components is greater than 4,
+* this parameter is part of a larger uniform like a GLSL matrix or array.
+* The next program parameter's Size will be Size-4 of this parameter.
+*/
+   GLuint Size;
GLboolean Used;  /** Helper flag for GLSL uniform tracking */
GLboolean Initialized;   /** Has the ParameterValue[] been set? */
GLbitfield Flags;/** Bitmask of PROG_PARAM_*_BIT */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Fetch tile only if a color buffer is bound.

2009-10-03 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: cbb57bf726619a34a244acaebf0dcd77750cba54
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbb57bf726619a34a244acaebf0dcd77750cba54

Author: José Fonseca jfons...@vmware.com
Date:   Sat Oct  3 19:42:22 2009 +0100

llvmpipe: Fetch tile only if a color buffer is bound.

---

 src/gallium/drivers/llvmpipe/lp_setup.c  |   10 --
 src/gallium/drivers/llvmpipe/lp_tile_cache.c |3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c 
b/src/gallium/drivers/llvmpipe/lp_setup.c
index 2d2fc19..6010721 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -124,7 +124,7 @@ shade_quads(struct llvmpipe_context *llvmpipe,
struct quad_header *quad = quads[0];
const unsigned x = quad-input.x0;
const unsigned y = quad-input.y0;
-   uint8_t *tile = lp_get_cached_tile(llvmpipe-cbuf_cache[0], x, y);
+   uint8_t *tile;
uint8_t *color;
void *depth;
uint32_t ALIGN16_ATTRIB mask[4][NUM_CHANNELS];
@@ -150,7 +150,13 @@ shade_quads(struct llvmpipe_context *llvmpipe,
  mask[q][chan_index] = quads[q]-inout.mask  (1  chan_index) ? ~0 : 
0;
 
/* color buffer */
-   color = TILE_PIXEL(tile, x  (TILE_SIZE-1), y  (TILE_SIZE-1), 0);
+   if(llvmpipe-framebuffer.nr_cbufs = 1 
+  llvmpipe-framebuffer.cbufs[0]) {
+  tile = lp_get_cached_tile(llvmpipe-cbuf_cache[0], x, y);
+  color = TILE_PIXEL(tile, x  (TILE_SIZE-1), y  (TILE_SIZE-1), 0);
+   }
+   else
+  color = NULL;
 
/* depth buffer */
if(llvmpipe-zsbuf_map) {
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c 
b/src/gallium/drivers/llvmpipe/lp_tile_cache.c
index 0c06b65..2ac8cb5 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c
+++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c
@@ -294,6 +294,9 @@ lp_get_cached_tile(struct llvmpipe_tile_cache *tc,
struct llvmpipe_cached_tile *tile = tc-entries[y/TILE_SIZE][x/TILE_SIZE];
struct pipe_transfer *pt = tc-transfer;

+   assert(tc-surface);
+   assert(tc-transfer);
+
switch(tile-status) {
case LP_TILE_STATUS_CLEAR:
   /* don't get tile from framebuffer, just clear it */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): intel: Suppress a compiler warning for an pointer-int cast

2009-10-03 Thread Chris Wilson
Module: Mesa
Branch: master
Commit: f194d2737b059cf6b99caa18f8ec2d46a55ada88
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f194d2737b059cf6b99caa18f8ec2d46a55ada88

Author: Chris Wilson ch...@chris-wilson.co.uk
Date:   Sat Oct  3 23:08:39 2009 +0100

intel: Suppress a compiler warning for an pointer-int cast

intel_pixel_read.c: In function ‘do_blit_readpixels’:
intel_pixel_read.c:221: warning: cast from pointer to integer of
different size

Cast via an intermediate (GLintptr) instead and hope the result fits
within GLuint... [It should as we simply do not support textures *that*
large!]

Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk

---

 src/mesa/drivers/dri/intel/intel_pixel_read.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c 
b/src/mesa/drivers/dri/intel/intel_pixel_read.c
index bc67f62..44a8695 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c
@@ -216,9 +216,8 @@ do_blit_readpixels(GLcontext * ctx,
   rowLength = -rowLength;
}
 
-   /* XXX 64-bit cast? */
-   dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height,
- format, type, 0, 0, 0);
+   dst_offset = (GLintptr) _mesa_image_address(2, pack, pixels, width, height,
+  format, type, 0, 0, 0);
 
 
/* Although the blits go on the command buffer, need to do this and

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit