Mesa (master): xorg/vmwgfx: Kill this target. It's not used anymore.

2011-09-30 Thread Thomas Hellstrom
Module: Mesa
Branch: master
Commit: d742a64909b2b414fc94b6f525a13ce09ca7f9f7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d742a64909b2b414fc94b6f525a13ce09ca7f9f7

Author: Thomas Hellstrom thellst...@vmware.com
Date:   Thu Sep 29 21:41:21 2011 +0200

xorg/vmwgfx: Kill this target. It's not used anymore.

This fixes a build error introduced with commit
winsys/svga: Update to vmwgfx kernel module 2.1
if both the svga driver and the xorg state tracker was enabled
at the same time.

If needed we can re-add a minimal target for basic functionality.

Signed-off-by: Thomas Hellstrom thellst...@vmware.com

---

 configure.ac  |2 +-
 src/gallium/SConscript|1 -
 src/gallium/targets/xorg-vmwgfx/Makefile  |   33 -
 src/gallium/targets/xorg-vmwgfx/SConscript|   63 --
 src/gallium/targets/xorg-vmwgfx/vmw_ctrl.c|  524 --
 src/gallium/targets/xorg-vmwgfx/vmw_ctrl.h|   48 -
 src/gallium/targets/xorg-vmwgfx/vmw_driver.h  |  120 ---
 src/gallium/targets/xorg-vmwgfx/vmw_hook.h|   39 -
 src/gallium/targets/xorg-vmwgfx/vmw_ioctl.c   |  260 -
 src/gallium/targets/xorg-vmwgfx/vmw_screen.c  |  267 -
 src/gallium/targets/xorg-vmwgfx/vmw_target.c  |   26 -
 src/gallium/targets/xorg-vmwgfx/vmw_video.c   | 1089 -
 src/gallium/targets/xorg-vmwgfx/vmw_xorg.c|  191 
 src/gallium/targets/xorg-vmwgfx/vmwarectrlproto.h |  122 ---
 14 files changed, 1 insertions(+), 2784 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=d742a64909b2b414fc94b6f525a13ce09ca7f9f7
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: simplify parameters to GetTexImage() driver hook

2011-09-30 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 4368a657670f1f3f13d8497f749cb5439f91529e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4368a657670f1f3f13d8497f749cb5439f91529e

Author: Brian Paul bri...@vmware.com
Date:   Fri Sep 30 08:15:30 2011 -0600

mesa: simplify parameters to GetTexImage() driver hook

The target, level and texObj can be obtained through the texImage
parameter.  We could make similar changes for the TexImage() hooks too.

Reviewed-by: Eric Anholt e...@anholt.net

---

 src/mesa/drivers/common/meta.c |7 +++
 src/mesa/drivers/common/meta.h |3 +--
 src/mesa/main/dd.h |3 +--
 src/mesa/main/debug.c  |4 +---
 src/mesa/main/mipmap.c |5 +++--
 src/mesa/main/texgetimage.c|   22 ++
 src/mesa/main/texgetimage.h|3 +--
 src/mesa/state_tracker/st_cb_texture.c |   16 ++--
 8 files changed, 26 insertions(+), 37 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index b6e80d7..0291368 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3260,9 +3260,8 @@ decompress_texture_image(struct gl_context *ctx,
  * from core Mesa.
  */
 void
-_mesa_meta_GetTexImage(struct gl_context *ctx, GLenum target, GLint level,
+_mesa_meta_GetTexImage(struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
-   struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
 {
/* We can only use the decompress-with-blit method here if the texels are
@@ -3272,6 +3271,7 @@ _mesa_meta_GetTexImage(struct gl_context *ctx, GLenum 
target, GLint level,
if (_mesa_is_format_compressed(texImage-TexFormat) 
_mesa_get_format_datatype(texImage-TexFormat)
== GL_UNSIGNED_NORMALIZED) {
+  struct gl_texture_object *texObj = texImage-TexObject;
   const GLuint slice = 0; /* only 2D compressed textures for now */
   /* Need to unlock the texture here to prevent deadlock... */
   _mesa_unlock_texture(ctx, texObj);
@@ -3281,7 +3281,6 @@ _mesa_meta_GetTexImage(struct gl_context *ctx, GLenum 
target, GLint level,
   _mesa_lock_texture(ctx, texObj);
}
else {
-  _mesa_get_teximage(ctx, target, level, format, type, pixels,
-  texObj, texImage);
+  _mesa_get_teximage(ctx, format, type, pixels, texImage);
}
 }
diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h
index 3c91792..7ec5683 100644
--- a/src/mesa/drivers/common/meta.h
+++ b/src/mesa/drivers/common/meta.h
@@ -124,9 +124,8 @@ _mesa_meta_CopyTexSubImage3D(struct gl_context *ctx, GLenum 
target, GLint level,
  GLsizei width, GLsizei height);
 
 extern void
-_mesa_meta_GetTexImage(struct gl_context *ctx, GLenum target, GLint level,
+_mesa_meta_GetTexImage(struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
-   struct gl_texture_object *texObj,
struct gl_texture_image *texImage);
 
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 720e4f5..91ecc0b 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -284,9 +284,8 @@ struct dd_function_table {
/**
 * Called by glGetTexImage().
 */
-   void (*GetTexImage)( struct gl_context *ctx, GLenum target, GLint level,
+   void (*GetTexImage)( struct gl_context *ctx,
 GLenum format, GLenum type, GLvoid *pixels,
-struct gl_texture_object *texObj,
 struct gl_texture_image *texImage );
 
/**
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 0a393e5..6e695d1 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -268,9 +268,7 @@ write_texture_image(struct gl_texture_object *texObj,
   store = ctx-Pack; /* save */
   ctx-Pack = ctx-DefaultPacking;
 
-  ctx-Driver.GetTexImage(ctx, texObj-Target, level,
-  GL_RGBA, GL_UNSIGNED_BYTE,
-  buffer, texObj, img);
+  ctx-Driver.GetTexImage(ctx, GL_RGBA, GL_UNSIGNED_BYTE, buffer, img);
 
   /* make filename */
   _mesa_snprintf(s, sizeof(s), /tmp/tex%u.l%u.f%u.ppm, texObj-Name, 
level, face);
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index e0cc6a2..7325a42 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -2032,9 +2032,10 @@ generate_mipmap_compressed(struct gl_context *ctx, 
GLenum target,
   ctx-Pack = ctx-DefaultPacking;
 
   /* Get the uncompressed image */
-  ctx-Driver.GetTexImage(ctx, target, texObj-BaseLevel,
+  assert(srcImage-Level == texObj-BaseLevel);
+  ctx-Driver.GetTexImage(ctx,
   temp_base_format, temp_datatype,
-  temp_src, texObj, srcImage);
+ 

Mesa (master): st/mesa: implement AllocTextureImageBuffer() driver hook

2011-09-30 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 4e6bb0774ffa93141a3a8ec7bb47b190810b2a4b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e6bb0774ffa93141a3a8ec7bb47b190810b2a4b

Author: Brian Paul bri...@vmware.com
Date:   Fri Sep 30 08:15:30 2011 -0600

st/mesa: implement AllocTextureImageBuffer() driver hook

This hasn't been needed so far since none of the core Mesa code paths
that call ctx-Driver.AllocTextureImageBuffer() are used with the
state tracker.  That will change in upcoming patches.
Note that this function duplicates some code seen in the st_TexImage()
function.  That can be cleaned up later.

---

 src/mesa/state_tracker/st_cb_texture.c |   86 
 1 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index b410247..76bf78b 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -460,6 +460,91 @@ guess_and_alloc_texture(struct st_context *st,
 
 
 /**
+ * Called via ctx-Driver.AllocTextureImageBuffer().
+ * If the texture object/buffer already has space for the indicated image,
+ * we're done.  Otherwise, allocate memory for the new texture image.
+ * XXX This function and st_TexImage() have some duplicated code.  That
+ * can be cleaned up in the future.
+ */
+static GLboolean
+st_AllocTextureImageBuffer(struct gl_context *ctx,
+   struct gl_texture_image *texImage,
+   gl_format format, GLsizei width,
+   GLsizei height, GLsizei depth)
+{
+   struct st_context *st = st_context(ctx);
+   struct st_texture_image *stImage = st_texture_image(texImage);
+   struct st_texture_object *stObj = st_texture_object(texImage-TexObject);
+   const GLuint level = texImage-Level;
+
+   DBG(%s\n, __FUNCTION__);
+
+   assert(width  0);
+   assert(height  0);
+   assert(depth  0);
+   assert(!texImage-Data);
+   assert(!stImage-pt); /* xxx this might be wrong */
+
+   /* Look if the parent texture object has space for this image */
+   if (stObj-pt 
+   level = stObj-pt-last_level 
+   st_texture_match_image(stObj-pt, texImage)) {
+  /* this image will fit in the existing texture object's memory */
+  pipe_resource_reference(stImage-pt, stObj-pt);
+  return GL_TRUE;
+   }
+
+   /* The parent texture object does not have space for this image */
+
+   pipe_resource_reference(stObj-pt, NULL);
+   pipe_sampler_view_reference(stObj-sampler_view, NULL);
+
+   if (!guess_and_alloc_texture(st, stObj, stImage)) {
+  /* Probably out of memory.
+   * Try flushing any pending rendering, then retry.
+   */
+  st_finish(st);
+  if (!guess_and_alloc_texture(st, stObj, stImage)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, glTexImage);
+ return GL_FALSE;
+  }
+   }
+
+   if (stObj-pt 
+   st_texture_match_image(stObj-pt, texImage)) {
+  /* The image will live in the object's mipmap memory */
+  pipe_resource_reference(stImage-pt, stObj-pt);
+  assert(stImage-pt);
+  return GL_TRUE;
+   }
+   else {
+  /* Create a new, temporary texture/resource/buffer to hold this
+   * one texture image.
+   */
+  enum pipe_format format =
+ st_mesa_format_to_pipe_format(texImage-TexFormat);
+  GLuint bindings = default_bindings(st, format);
+  GLuint ptWidth, ptHeight, ptDepth, ptLayers;
+
+  st_gl_texture_dims_to_pipe_dims(stObj-base.Target,
+  width, height, depth,
+  ptWidth, ptHeight, ptDepth, 
ptLayers);
+
+  stImage-pt = st_texture_create(st,
+  gl_target_to_pipe(stObj-base.Target),
+  format,
+  0, /* lastLevel */
+  ptWidth,
+  ptHeight,
+  ptDepth,
+  ptLayers,
+  bindings);
+  return stImage-pt != NULL;
+   }
+}
+
+
+/**
  * Adjust pixel unpack params and image dimensions to strip off the
  * texture border.
  * Gallium doesn't support texture borders.  They've seldem been used
@@ -1837,6 +1922,7 @@ st_init_texture_functions(struct dd_function_table 
*functions)
functions-NewTextureImage = st_NewTextureImage;
functions-DeleteTextureImage = st_DeleteTextureImage;
functions-DeleteTexture = st_DeleteTextureObject;
+   functions-AllocTextureImageBuffer = st_AllocTextureImageBuffer;
functions-FreeTextureImageBuffer = st_FreeTextureImageBuffer;
functions-MapTextureImage = st_MapTextureImage;
functions-UnmapTextureImage = st_UnmapTextureImage;

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


Mesa (master): mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()

2011-09-30 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 57169c469406f1880107a6b9f052708ce078942d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=57169c469406f1880107a6b9f052708ce078942d

Author: Brian Paul bri...@vmware.com
Date:   Fri Sep 30 08:15:30 2011 -0600

mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()

If color material mode is enabled, constant buffer entries related
to the material coefficients will depend on glColor.  So add
_NEW_CURRENT_ATTRIB to the bitset returned for material-related
constants in _mesa_program_state_flags().

This fixes a bug exercised by the new piglit draw-arrays-colormaterial
test.

Note: This is a candidate for the 7.11 branch.

---

 src/mesa/program/prog_statevars.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/program/prog_statevars.c 
b/src/mesa/program/prog_statevars.c
index 6aa2409..f34a6d3 100644
--- a/src/mesa/program/prog_statevars.c
+++ b/src/mesa/program/prog_statevars.c
@@ -664,10 +664,13 @@ _mesa_program_state_flags(const gl_state_index 
state[STATE_LENGTH])
 {
switch (state[0]) {
case STATE_MATERIAL:
+   case STATE_LIGHTPROD:
+   case STATE_LIGHTMODEL_SCENECOLOR:
+  /* these can be effected by glColor when colormaterial mode is used */
+  return _NEW_LIGHT | _NEW_CURRENT_ATTRIB;
+
case STATE_LIGHT:
case STATE_LIGHTMODEL_AMBIENT:
-   case STATE_LIGHTMODEL_SCENECOLOR:
-   case STATE_LIGHTPROD:
   return _NEW_LIGHT;
 
case STATE_TEXGEN:

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


Mesa (master): meta: fix GetTexImage() for luminance, l/a, intensity formats

2011-09-30 Thread Brian Paul
Module: Mesa
Branch: master
Commit: a8ca786ba69f6af0120a24f473b2ae7e6a41495d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8ca786ba69f6af0120a24f473b2ae7e6a41495d

Author: Brian Paul bri...@vmware.com
Date:   Fri Sep 30 08:15:30 2011 -0600

meta: fix GetTexImage() for luminance, l/a, intensity formats

The GL spec says that luminance values are returned as (l, 0, 0, 1),
L/A values as (l, 0, 0, a) and intensity values as (i, 0, 0, 1).
Use the pixel transfer scale controls to implement that.
This fixes a few failures in the new piglit getteximage-formats
test when getting a compressed L or L/A image.

---

 src/mesa/drivers/common/meta.c |   24 ++--
 src/mesa/main/pixel.c  |2 +-
 src/mesa/main/pixel.h  |9 +
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 0291368..4d645e2 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -49,6 +49,7 @@
 #include main/macros.h
 #include main/matrix.h
 #include main/mipmap.h
+#include main/pixel.h
 #include main/pbo.h
 #include main/polygon.h
 #include main/readpix.h
@@ -3235,8 +3236,27 @@ decompress_texture_image(struct gl_context *ctx,
}
 
/* read pixels from renderbuffer */
-   ctx-Pack.RowLength = destRowLength;
-   _mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest);
+   {
+  GLenum baseTexFormat = texImage-_BaseFormat;
+
+  /* The pixel transfer state will be set to default values at this point
+   * (see MESA_META_PIXEL_TRANSFER) so pixel transfer ops are effectively
+   * turned off (as required by glGetTexImage) but we need to handle some
+   * special cases.  In particular, single-channel texture values are
+   * returned as red and two-channel texture values are returned as
+   * red/alpha.
+   */
+  if (baseTexFormat == GL_LUMINANCE ||
+  baseTexFormat == GL_LUMINANCE_ALPHA ||
+  baseTexFormat == GL_INTENSITY) {
+ /* Green and blue must be zero */
+ _mesa_PixelTransferf(GL_GREEN_SCALE, 0.0f);
+ _mesa_PixelTransferf(GL_BLUE_SCALE, 0.0f);
+  }
+
+  ctx-Pack.RowLength = destRowLength;
+  _mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest);
+   }
 
/* disable texture unit */
_mesa_set_enable(ctx, target, GL_FALSE);
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index c87f5e0..e73c5a4 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -506,7 +506,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values )
  * Implements glPixelTransfer[fi] whether called immediately or from a
  * display list.
  */
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_PixelTransferf( GLenum pname, GLfloat param )
 {
GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h
index 6f04eb6..558b106 100644
--- a/src/mesa/main/pixel.h
+++ b/src/mesa/main/pixel.h
@@ -43,6 +43,9 @@ struct gl_context;
 
 #if FEATURE_pixel_transfer
 
+extern void GLAPIENTRY
+_mesa_PixelTransferf(GLenum pname, GLfloat param);
+
 extern void 
 _mesa_update_pixel( struct gl_context *ctx, GLuint newstate );
 
@@ -51,6 +54,12 @@ _mesa_init_pixel_dispatch( struct _glapi_table * disp );
 
 #else /* FEATURE_pixel_transfer */
 
+static inline void GLAPIENTRY
+_mesa_PixelTransferf(GLenum pname, GLfloat param)
+{
+}
+
+
 static INLINE void
 _mesa_update_pixel(struct gl_context *ctx, GLuint newstate)
 {

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


Demos (master): glinfo: query/print GL_SHADING_LANGUAGE_VERSION

2011-09-30 Thread Brian Paul
Module: Demos
Branch: master
Commit: d88c79b570aa74a96ad9cd4906addfa018fd5bc6
URL:
http://cgit.freedesktop.org/mesa/demos/commit/?id=d88c79b570aa74a96ad9cd4906addfa018fd5bc6

Author: Brian Paul bri...@vmware.com
Date:   Fri Sep 30 09:51:15 2011 -0600

glinfo: query/print GL_SHADING_LANGUAGE_VERSION

And print extensions after vendor, version, renderer.

---

 src/demos/glinfo.c |   13 -
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/demos/glinfo.c b/src/demos/glinfo.c
index d4164ff..7dd384f 100644
--- a/src/demos/glinfo.c
+++ b/src/demos/glinfo.c
@@ -18,9 +18,20 @@ int main( int argc, char *argv[] )
glutCreateWindow(argv[0]);
 
printf(GL_VERSION: %s\n, (char *) glGetString(GL_VERSION));
-   printf(GL_EXTENSIONS: %s\n, (char *) glGetString(GL_EXTENSIONS));
printf(GL_RENDERER: %s\n, (char *) glGetString(GL_RENDERER));
printf(GL_VENDOR: %s\n, (char *) glGetString(GL_VENDOR));
+   printf(GL_EXTENSIONS: %s\n, (char *) glGetString(GL_EXTENSIONS));
+
+#ifdef GL_VERSION_2_0
+   {
+  const GLubyte *v = glGetString(GL_VERSION);
+  if (v[0] * 10 + v[2] = 20) {
+ const GLubyte *slv = glGetString(GL_SHADING_LANGUAGE_VERSION);
+ printf(GL_SHADING_LANGUAGE_VERSION = %s\n, slv);
+  }
+   }
+#endif
+
printf(GLU_VERSION: %s\n, (char *) gluGetString(GLU_VERSION));
printf(GLU_EXTENSIONS: %s\n, (char *) gluGetString(GLU_EXTENSIONS));
printf(GLUT_API_VERSION: %d\n, GLUT_API_VERSION);

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


Mesa (master): mesa: Remove unused tnl items from dd_functions

2011-09-30 Thread Chad Versace
Module: Mesa
Branch: master
Commit: 9c72b729f34e1d544a66222c90561f93db6cb132
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c72b729f34e1d544a66222c90561f93db6cb132

Author: Chad Versace c...@chad-versace.us
Date:   Wed Sep 28 16:59:08 2011 -0700

mesa: Remove unused tnl items from dd_functions

Remove NeedValidate and ValidateTnlModule.

Reviewed-by: Eric Anholt e...@anholt.net
Signed-off-by: Chad Versace c...@chad-versace.us

---

 src/mesa/drivers/common/driverfuncs.c |2 --
 src/mesa/main/dd.h|   19 ---
 2 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 3e28969..33da934 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -200,8 +200,6 @@ _mesa_init_driver_functions(struct dd_function_table 
*driver)
_mesa_init_sampler_object_functions(driver);
 
/* TL stuff */
-   driver-NeedValidate = GL_FALSE;
-   driver-ValidateTnlModule = NULL;
driver-CurrentExecPrimitive = 0;
driver-CurrentSavePrimitive = 0;
driver-NeedFlush = 0;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 91ecc0b..7875564 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -814,25 +814,6 @@ struct dd_function_table {
/*@{*/
 
/**
-* Bitmask of state changes that require the current TL module to be
-* validated, using ValidateTnlModule() below.
-*/
-   GLuint NeedValidate;
-
-   /**
-* Validate the current TL module. 
-*
-* This is called directly after UpdateState() when a state change that has
-* occurred matches the dd_function_table::NeedValidate bitmask above.  This
-* ensures all computed values are up to date, thus allowing the driver to
-* decide if the current TL module needs to be swapped out.
-*
-* This must be non-NULL if a driver installs a custom TL module and sets
-* the dd_function_table::NeedValidate bitmask, but may be NULL otherwise.
-*/
-   void (*ValidateTnlModule)( struct gl_context *ctx, GLuint new_state );
-
-   /**
 * Set by the driver-supplied TL engine.  
 *
 * Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().

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


Mesa (master): glcpp: Add a test for a macro that implements token pasting twice.

2011-09-30 Thread Carl Worth
Module: Mesa
Branch: master
Commit: 8e6b99e7b13da33547fcc8388fe867e851ee0bda
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e6b99e7b13da33547fcc8388fe867e851ee0bda

Author: Carl Worth cwo...@cworth.org
Date:   Thu Sep 29 16:50:40 2011 -0700

glcpp: Add a test for a macro that implements token pasting twice.

This is something that piglit is exercising that currently fails.

Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Signed-off-by: Carl Worth cwo...@cworth.org

---

 src/glsl/glcpp/tests/096-paste-twice.c  |3 +++
 src/glsl/glcpp/tests/096-paste-twice.c.expected |4 
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/glsl/glcpp/tests/096-paste-twice.c 
b/src/glsl/glcpp/tests/096-paste-twice.c
new file mode 100644
index 000..8da756f
--- /dev/null
+++ b/src/glsl/glcpp/tests/096-paste-twice.c
@@ -0,0 +1,3 @@
+#define paste_twice(a,b,c) a ## b ## c
+paste_twice(just, one, token)
+
diff --git a/src/glsl/glcpp/tests/096-paste-twice.c.expected 
b/src/glsl/glcpp/tests/096-paste-twice.c.expected
new file mode 100644
index 000..e401941
--- /dev/null
+++ b/src/glsl/glcpp/tests/096-paste-twice.c.expected
@@ -0,0 +1,4 @@
+
+justonetoken
+
+

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


Mesa (master): glcpp: Test a non-function-like macro using the token paste operator

2011-09-30 Thread Carl Worth
Module: Mesa
Branch: master
Commit: 7bb3403e0172a440b8100bcf1db8462f50a254cc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bb3403e0172a440b8100bcf1db8462f50a254cc

Author: Carl Worth cwo...@cworth.org
Date:   Thu Sep 29 17:04:09 2011 -0700

glcpp: Test a non-function-like macro using the token paste operator

Apparently we never implemented this, (but we've got a GLSL 1.30 test
in piglit that is exercising this case).

Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Signed-off-by: Carl Worth cwo...@cworth.org

---

 .../tests/097-paste-with-non-function-macro.c  |3 +++
 .../097-paste-with-non-function-macro.c.expected   |4 
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c 
b/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c
new file mode 100644
index 000..0f46835
--- /dev/null
+++ b/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c
@@ -0,0 +1,3 @@
+#define PASTE_MACRO one ## token
+PASTE_MACRO
+
diff --git a/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected 
b/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected
new file mode 100644
index 000..af92187
--- /dev/null
+++ b/src/glsl/glcpp/tests/097-paste-with-non-function-macro.c.expected
@@ -0,0 +1,4 @@
+
+onetoken
+
+

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


Mesa (master): glcpp: Fix two (or more) successive applications of token pasting

2011-09-30 Thread Carl Worth
Module: Mesa
Branch: master
Commit: 3c01a589448b92945f26bd7e3bfa75155c06f3cf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c01a589448b92945f26bd7e3bfa75155c06f3cf

Author: Carl Worth cwo...@cworth.org
Date:   Thu Sep 29 16:51:08 2011 -0700

glcpp: Fix two (or more) successive applications of token pasting

There was already a loop here to look for multiple token pastes, but
it was mistakenly incrementing the iterator counter after performing
one paste.

Instead, leave the loop iterator in place to coalesce as many tokens
as necessary into one.

This fixes the recently add 096-paste-twice test as well as the
following piglit test:

spec/glsl-1.30/preprocessor/concat/concat-03.frag

Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Signed-off-by: Carl Worth cwo...@cworth.org

---

 src/glsl/glcpp/glcpp-parse.y |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 9408304..d547ecf 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1418,8 +1418,6 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
node-next = next_non_space-next;
if (next_non_space == substituted-tail)
substituted-tail = node;
-
-   node = node-next;
}
 
substituted-non_space_tail = substituted-tail;

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


Mesa (master): glcpp: Raise error if defining any macro containing two consecutive underscores

2011-09-30 Thread Carl Worth
Module: Mesa
Branch: master
Commit: c4aaf7943c2cdff0e2148b5c05813356dc99696d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c4aaf7943c2cdff0e2148b5c05813356dc99696d

Author: Carl Worth cwo...@cworth.org
Date:   Thu Sep 29 21:44:52 2011 -0700

glcpp: Raise error if defining any macro containing two consecutive underscores

The specification reserves any macro name containing two consecutive
underscores, (anywhere within the name). Previously, we only raised
this error for macro names that started with two underscores.

Fix the implementation to check for two underscores anywhere, and also
update the corresponding 086-reserved-macro-names test.

This also fixes the following two piglit tests:

spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag

Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Reviewed-by: Eric Anholt e...@anholt.net
Signed-off-by: Carl Worth cwo...@cworth.org

---

 src/glsl/glcpp/glcpp-parse.y   |4 ++--
 src/glsl/glcpp/tests/086-reserved-macro-names.c|1 +
 .../tests/086-reserved-macro-names.c.expected  |5 -
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index ff9fa7a..17941a9 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1663,8 +1663,8 @@ _check_for_reserved_macro_name (glcpp_parser_t *parser, 
YYLTYPE *loc,
/* According to the GLSL specification, macro names starting with __
 * or GL_ are reserved for future use.  So, don't allow them.
 */
-   if (strncmp(identifier, __, 2) == 0) {
-   glcpp_error (loc, parser, Macro names starting with \__\ are 
reserved.\n);
+   if (strstr(identifier, __)) {
+   glcpp_error (loc, parser, Macro names containing \__\ are 
reserved.\n);
}
if (strncmp(identifier, GL_, 3) == 0) {
glcpp_error (loc, parser, Macro names starting with \GL_\ 
are reserved.\n);
diff --git a/src/glsl/glcpp/tests/086-reserved-macro-names.c 
b/src/glsl/glcpp/tests/086-reserved-macro-names.c
index fd0c29f..a6b7201 100644
--- a/src/glsl/glcpp/tests/086-reserved-macro-names.c
+++ b/src/glsl/glcpp/tests/086-reserved-macro-names.c
@@ -1,2 +1,3 @@
 #define __BAD reserved
 #define GL_ALSO_BAD() also reserved
+#define THIS__TOO__IS__BAD reserved
diff --git a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected 
b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
index 6a9df68..d8aa9f0 100644
--- a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
+++ b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
@@ -1,7 +1,10 @@
-0:1(10): preprocessor error: Macro names starting with __ are reserved.
+0:1(10): preprocessor error: Macro names containing __ are reserved.
 
 0:2(9): preprocessor error: Macro names starting with GL_ are reserved.
 
+0:3(9): preprocessor error: Macro names containing __ are reserved.
+
+
 
 
 

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


Mesa (master): glcpp: Implement token pasting for non-function-like macros

2011-09-30 Thread Carl Worth
Module: Mesa
Branch: master
Commit: 28842c2331e6df2cbe18c0be3487ece93680075d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=28842c2331e6df2cbe18c0be3487ece93680075d

Author: Carl Worth cwo...@cworth.org
Date:   Thu Sep 29 17:04:47 2011 -0700

glcpp: Implement token pasting for non-function-like macros

This is as simple as abstracting one existing block of code into a
function call and then adding a single call to that function for the
case of a non-function-like macro.

This fixes the recently-added 097-paste-with-non-function-macro test
as well as the following piglit tests:

spec/glsl-1.30/preprocessor/concat/concat-01.frag
spec/glsl-1.30/preprocessor/concat/concat-02.frag

Also, the concat-04.frag test now passes for the right reason. The
test is intended to fail the compilation, but before this commit it
was failing compilation (and hence passing the test) for the wrong
reason.

Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Signed-off-by: Carl Worth cwo...@cworth.org

---

 src/glsl/glcpp/glcpp-parse.y |   83 --
 1 files changed, 47 insertions(+), 36 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index d547ecf..ff9fa7a 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1275,6 +1275,48 @@ _glcpp_parser_expand_if (glcpp_parser_t *parser, int 
type, token_list_t *list)
glcpp_parser_lex_from (parser, expanded);
 }
 
+static void
+_glcpp_parser_apply_pastes (glcpp_parser_t *parser, token_list_t *list)
+{
+   token_node_t *node;
+
+   node = list-head;
+   while (node)
+   {
+   token_node_t *next_non_space;
+
+   /* Look ahead for a PASTE token, skipping space. */
+   next_non_space = node-next;
+   while (next_non_space  next_non_space-token-type == SPACE)
+   next_non_space = next_non_space-next;
+
+   if (next_non_space == NULL)
+   break;
+
+   if (next_non_space-token-type != PASTE) {
+   node = next_non_space;
+   continue;
+   }
+
+   /* Now find the next non-space token after the PASTE. */
+   next_non_space = next_non_space-next;
+   while (next_non_space  next_non_space-token-type == SPACE)
+   next_non_space = next_non_space-next;
+
+   if (next_non_space == NULL) {
+   yyerror (node-token-location, parser, '##' cannot 
appear at either end of a macro expansion\n);
+   return;
+   }
+
+   node-token = _token_paste (parser, node-token, 
next_non_space-token);
+   node-next = next_non_space-next;
+   if (next_non_space == list-tail)
+   list-tail = node;
+   }
+
+   list-non_space_tail = list-tail;
+}
+
 /* This is a helper function that's essentially part of the
  * implementation of _glcpp_parser_expand_node. It shouldn't be called
  * except for by that function.
@@ -1386,41 +1428,7 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
 
_token_list_trim_trailing_space (substituted);
 
-   node = substituted-head;
-   while (node)
-   {
-   token_node_t *next_non_space;
-
-   /* Look ahead for a PASTE token, skipping space. */
-   next_non_space = node-next;
-   while (next_non_space  next_non_space-token-type == SPACE)
-   next_non_space = next_non_space-next;
-
-   if (next_non_space == NULL)
-   break;
-
-   if (next_non_space-token-type != PASTE) {
-   node = next_non_space;
-   continue;
-   }
-
-   /* Now find the next non-space token after the PASTE. */
-   next_non_space = next_non_space-next;
-   while (next_non_space  next_non_space-token-type == SPACE)
-   next_non_space = next_non_space-next;
-
-   if (next_non_space == NULL) {
-   yyerror (node-token-location, parser, '##' cannot 
appear at either end of a macro expansion\n);
-   return NULL;
-   }
-
-   node-token = _token_paste (parser, node-token, 
next_non_space-token);
-   node-next = next_non_space-next;
-   if (next_non_space == substituted-tail)
-   substituted-tail = node;
-   }
-
-   substituted-non_space_tail = substituted-tail;
+   _glcpp_parser_apply_pastes (parser, substituted);
 
return substituted;
 }
@@ -1490,13 +1498,16 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
 
if (! macro-is_function)
{
+   token_list_t *replacement;
*last = node;
 
/* Replace a macro defined 

Mesa (master): glcpp: Add a test for #elif with an undefined macro.

2011-09-30 Thread Carl Worth
Module: Mesa
Branch: master
Commit: 201485bae0fcba4db61ceb1e9d9916778b5bba74
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=201485bae0fcba4db61ceb1e9d9916778b5bba74

Author: Carl Worth cwo...@cworth.org
Date:   Thu Sep 29 22:24:18 2011 -0700

glcpp: Add a test for #elif with an undefined macro.

As written, this test correctly raises an error for #elif being used
with an undefined macro (and not as an argument to defined). If the
preceding #if were '#if 1' then this diagnositc would correctly be
hidden. That allows code such as the following to not raise an error:

#ifndef MAYBE_UNDEFINED
#elif MAYBE_UNDEFINED  5
...
#endif

So this test case is working as expected already. We add it here just
to improve test coverage.

Reviewed-by: Kenneth Graunke kenn...@whitecape.org
Signed-off-by: Carl Worth cwo...@cworth.org

---

 src/glsl/glcpp/tests/098-elif-undefined.c  |3 +++
 src/glsl/glcpp/tests/098-elif-undefined.c.expected |5 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/glsl/glcpp/tests/098-elif-undefined.c 
b/src/glsl/glcpp/tests/098-elif-undefined.c
new file mode 100644
index 000..52a331c
--- /dev/null
+++ b/src/glsl/glcpp/tests/098-elif-undefined.c
@@ -0,0 +1,3 @@
+#if 0
+#elif UNDEFINED_MACRO
+#endif
diff --git a/src/glsl/glcpp/tests/098-elif-undefined.c.expected 
b/src/glsl/glcpp/tests/098-elif-undefined.c.expected
new file mode 100644
index 000..de967ea
--- /dev/null
+++ b/src/glsl/glcpp/tests/098-elif-undefined.c.expected
@@ -0,0 +1,5 @@
+0:2(22): preprocessor error: syntax error, unexpected IDENTIFIER
+0:1(7): preprocessor error: Unterminated #if
+
+
+

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


Mesa (master): i965/gen6: Fix assign instead of compare in assert

2011-09-30 Thread Chris Wilson
Module: Mesa
Branch: master
Commit: 8ccbcda5c64a8bea47f6b41d46bf015ba8e515fc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ccbcda5c64a8bea47f6b41d46bf015ba8e515fc

Author: Chris Wilson ch...@chris-wilson.co.uk
Date:   Fri Sep 30 21:48:18 2011 +0100

i965/gen6: Fix assign instead of compare in assert

This is from a Coverity defect report.

src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
   268  static void
   269  check_gen6_math_src_arg(struct brw_reg src)
   270  {
   271 /* Source swizzles are ignored. */
   272 assert(!src.abs);
   273 assert(!src.negate);
- 274 assert(src.dw1.bits.swizzle = BRW_SWIZZLE_XYZW);
   275  }

Reported-by: Vinson Lee v...@vmware.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40214
Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk

---

 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
index 1eb8f3f..3feecbf 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
@@ -257,7 +257,7 @@ check_gen6_math_src_arg(struct brw_reg src)
/* Source swizzles are ignored. */
assert(!src.abs);
assert(!src.negate);
-   assert(src.dw1.bits.swizzle = BRW_SWIZZLE_XYZW);
+   assert(src.dw1.bits.swizzle == BRW_SWIZZLE_XYZW);
 }
 
 void

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


Mesa (master): i965: Assign instead of compare inside assert

2011-09-30 Thread Chris Wilson
Module: Mesa
Branch: master
Commit: ebca47af8507e0fc3f03d6c0f49be6b2d4d9a8a4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ebca47af8507e0fc3f03d6c0f49be6b2d4d9a8a4

Author: Chris Wilson ch...@chris-wilson.co.uk
Date:   Fri Sep 30 21:58:59 2011 +0100

i965: Assign instead of compare inside assert

This is from a Coverity defect report.

src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
  1314  void
  1315  vec4_visitor::emit_block_move(dst_reg *dst, src_reg *src,
  1316const struct glsl_type *type, bool
predicated)
...
  1351 /* Do we need to worry about swizzling a swizzle? */
-1352 assert(src-swizzle = BRW_SWIZZLE_NOOP);
  1353 src-swizzle = swizzle_for_size(type-vector_elements);

Reported-by: Vinson Lee v...@vmware.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40158
Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk

---

 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp 
b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 98ecd25..5815e31 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -1472,7 +1472,7 @@ vec4_visitor::emit_block_move(dst_reg *dst, src_reg *src,
dst-writemask = (1  type-vector_elements) - 1;
 
/* Do we need to worry about swizzling a swizzle? */
-   assert(src-swizzle = BRW_SWIZZLE_NOOP);
+   assert(src-swizzle == BRW_SWIZZLE_NOOP);
src-swizzle = swizzle_for_size(type-vector_elements);
 
vec4_instruction *inst = emit(MOV(*dst, *src));

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


Mesa (master): gallium: remove PIPE_CAP_TEXTURE_MIRROR_REPEAT

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 557c3febdfd88ba1a41d3e8e0221e447d491c343
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=557c3febdfd88ba1a41d3e8e0221e447d491c343

Author: Marek Olšák mar...@gmail.com
Date:   Mon Sep 26 22:50:00 2011 +0200

gallium: remove PIPE_CAP_TEXTURE_MIRROR_REPEAT

All drivers support it (well, except Cell). The boolean option is going away
from core Mesa too.

This is a follow-up to Ian Romanick's patch
mesa: Remove ARB_texture_mirrored_repeat extension enable flag.

Reviewed-by: Brian Paul bri...@vmware.com

---

 src/gallium/drivers/cell/ppu/cell_screen.c |2 --
 src/gallium/drivers/i915/i915_screen.c |1 -
 src/gallium/drivers/llvmpipe/lp_screen.c   |2 --
 src/gallium/drivers/nv50/nv50_screen.c |1 -
 src/gallium/drivers/nvc0/nvc0_screen.c |1 -
 src/gallium/drivers/nvfx/nvfx_screen.c |2 --
 src/gallium/drivers/r300/r300_screen.c |1 -
 src/gallium/drivers/r600/r600_pipe.c   |1 -
 src/gallium/drivers/softpipe/sp_screen.c   |2 --
 src/gallium/drivers/svga/svga_screen.c |3 ---
 src/gallium/include/pipe/p_defines.h   |1 -
 11 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c 
b/src/gallium/drivers/cell/ppu/cell_screen.c
index 0ee124a..a98529d 100644
--- a/src/gallium/drivers/cell/ppu/cell_screen.c
+++ b/src/gallium/drivers/cell/ppu/cell_screen.c
@@ -86,8 +86,6 @@ cell_get_param(struct pipe_screen *screen, enum pipe_cap 
param)
   return 8;  /* max 128x128x128 */
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
   return CELL_MAX_TEXTURE_LEVELS;
-   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
-  return 1; /* XXX not really true */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
   return 0; /* XXX to do */
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index edb693d..e0f44cd 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -111,7 +111,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
case PIPE_CAP_NPOT_TEXTURES:
case PIPE_CAP_POINT_SPRITE:
case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */
-   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_TWO_SIDED_STENCIL:
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c 
b/src/gallium/drivers/llvmpipe/lp_screen.c
index 9e2a45c..11a264c 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -137,8 +137,6 @@ llvmpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
   return 0;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
   return 1;
-   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
-  return 1;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
   return 1;
case PIPE_CAP_TEXTURE_SWIZZLE:
diff --git a/src/gallium/drivers/nv50/nv50_screen.c 
b/src/gallium/drivers/nv50/nv50_screen.c
index db775e8..59d2dfa 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -95,7 +95,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_MAX_TEXEL_OFFSET:
   return 0 /* +7, TODO */;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
-   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
case PIPE_CAP_TEXTURE_SWIZZLE:
case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_NPOT_TEXTURES:
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nvc0/nvc0_screen.c
index 64e4ec7..695144e 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -86,7 +86,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_MAX_TEXEL_OFFSET:
   return 7;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
-   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
case PIPE_CAP_TEXTURE_SWIZZLE:
case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_NPOT_TEXTURES:
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c 
b/src/gallium/drivers/nvfx/nvfx_screen.c
index 5729e66..49bd932 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -60,8 +60,6 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
return 13;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
return !!screen-use_nv4x;
-   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
-   return 1;
case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
return 0; /* We have 4 on nv40 - but unsupported currently */
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 3989113..5e3aeee 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -110,7 +110,6 @@ static int r300_get_param(struct 

Mesa (master): gallium: add and use PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: f5bfe54a34d9c8cd5de2b096d0e8486fe0d990a7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5bfe54a34d9c8cd5de2b096d0e8486fe0d990a7

Author: Marek Olšák mar...@gmail.com
Date:   Tue Sep 27 22:22:06 2011 +0200

gallium: add and use PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS

This removes:
- PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS
- PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS
in favor of the that new per-shader cap.

Reviewed-by: Brian Paul bri...@vmware.com

---

 src/gallium/auxiliary/tgsi/tgsi_exec.h |2 +
 src/gallium/drivers/cell/ppu/cell_screen.c |9 --
 src/gallium/drivers/i915/i915_screen.c |   12 ++---
 src/gallium/drivers/i965/brw_screen.c  |6 +---
 src/gallium/drivers/llvmpipe/lp_screen.c   |   25 ++-
 src/gallium/drivers/nv50/nv50_screen.c |5 +--
 src/gallium/drivers/nvc0/nvc0_screen.c |5 +--
 src/gallium/drivers/nvfx/nvfx_screen.c |8 +++---
 src/gallium/drivers/r300/r300_screen.c |5 ++-
 src/gallium/drivers/r600/r600_pipe.c   |5 +--
 src/gallium/drivers/softpipe/sp_screen.c   |   21 
 src/gallium/drivers/svga/svga_screen.c |4 +-
 src/gallium/include/pipe/p_defines.h   |5 +--
 .../state_trackers/d3d1x/gd3d11/d3d11_screen.h |2 +-
 src/mesa/state_tracker/st_extensions.c |6 +++-
 15 files changed, 64 insertions(+), 56 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h 
b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index a750715..223da2c 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -408,6 +408,8 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
   return 1;
case PIPE_SHADER_CAP_INTEGERS:
   return 1;
+   case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+  return PIPE_MAX_SAMPLERS;
default:
   return 0;
}
diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c 
b/src/gallium/drivers/cell/ppu/cell_screen.c
index a98529d..14a6173 100644
--- a/src/gallium/drivers/cell/ppu/cell_screen.c
+++ b/src/gallium/drivers/cell/ppu/cell_screen.c
@@ -58,8 +58,6 @@ static int
 cell_get_param(struct pipe_screen *screen, enum pipe_cap param)
 {
switch (param) {
-   case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
-  return CELL_MAX_SAMPLERS;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
   return CELL_MAX_SAMPLERS;
case PIPE_CAP_NPOT_TEXTURES:
@@ -107,7 +105,12 @@ cell_get_shader_param(struct pipe_screen *screen, unsigned 
shader, enum pipe_sha
switch(shader)
{
case PIPE_SHADER_FRAGMENT:
-  return tgsi_exec_get_shader_param(param);
+  switch (param) {
+  case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return CELL_MAX_SAMPLERS;
+  default:
+ return tgsi_exec_get_shader_param(param);
+  }
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_GEOMETRY:
   return draw_get_shader_param(shader, param);
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index e0f44cd..3d601a5 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -140,11 +140,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
   return is-debug.lie ? 1 : 0;
 
/* Texturing. */
-   case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
   return 8;
-   case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
-  return 0;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
   return I915_MAX_TEXTURE_2D_LEVELS;
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
@@ -178,7 +175,12 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned 
shader, enum pipe_sha
 {
switch(shader) {
case PIPE_SHADER_VERTEX:
-  return draw_get_shader_param(shader, cap);
+  switch (cap) {
+  case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 0;
+  default:
+ return draw_get_shader_param(shader, cap);
+  }
case PIPE_SHADER_FRAGMENT:
   break;
default:
@@ -220,6 +222,8 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned 
shader, enum pipe_sha
  return 0;
   case PIPE_SHADER_CAP_INTEGERS:
  return 0;
+  case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 8;
   default:
  debug_printf(%s: Unknown cap %u.\n, __FUNCTION__, cap);
  return 0;
diff --git a/src/gallium/drivers/i965/brw_screen.c 
b/src/gallium/drivers/i965/brw_screen.c
index 39e9e2f..076338a 100644
--- a/src/gallium/drivers/i965/brw_screen.c
+++ b/src/gallium/drivers/i965/brw_screen.c
@@ -154,10 +154,6 @@ static int
 brw_get_param(struct pipe_screen *screen, enum pipe_cap param)
 {
switch (param) {
-   case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
-  return 8;
-   case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
-  return 8;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
   return 16; /* XXX correct? */
   

Mesa (master): gallium: add PIPE_CAP_CONDITIONAL_RENDER

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 3d13b081c72626acba6b9a25baec740c60dfafe1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d13b081c72626acba6b9a25baec740c60dfafe1

Author: Marek Olšák mar...@gmail.com
Date:   Tue Sep 27 23:08:04 2011 +0200

gallium: add PIPE_CAP_CONDITIONAL_RENDER

We were checking whether render_condition is set. That was not reliable,
because it's always set with trace and noop regardless of driver support.

Reviewed-by: Brian Paul bri...@vmware.com

---

 src/gallium/drivers/nv50/nv50_screen.c |1 +
 src/gallium/drivers/nvc0/nvc0_screen.c |1 +
 src/gallium/drivers/r300/r300_screen.c |1 +
 src/gallium/drivers/r600/r600_pipe.c   |1 +
 src/gallium/drivers/softpipe/sp_screen.c   |2 ++
 src/gallium/include/pipe/p_defines.h   |3 ++-
 .../state_trackers/d3d1x/gd3d11/d3d11_context.h|2 +-
 src/mesa/state_tracker/st_extensions.c |2 +-
 8 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_screen.c 
b/src/gallium/drivers/nv50/nv50_screen.c
index bd405a7..d3fdd55 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -136,6 +136,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
+   case PIPE_CAP_CONDITIONAL_RENDER:
   return 1;
default:
   NOUVEAU_ERR(unknown PIPE_CAP %d\n, param);
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nvc0/nvc0_screen.c
index a28c7d7..9b97f24 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -124,6 +124,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
+   case PIPE_CAP_CONDITIONAL_RENDER:
   return 1;
default:
   NOUVEAU_ERR(unknown PIPE_CAP %d\n, param);
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index deb1428..7699ed6 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -114,6 +114,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
 case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
 case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
 case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
+case PIPE_CAP_CONDITIONAL_RENDER:
 return 1;
 
 /* r300 cannot do swizzling of compressed textures. Supported 
otherwise. */
diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index 25e7c43..ec0d58a 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -359,6 +359,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
case PIPE_CAP_SEAMLESS_CUBE_MAP:
case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL:
case PIPE_CAP_PRIMITIVE_RESTART:
+   case PIPE_CAP_CONDITIONAL_RENDER:
return 1;
 
/* Supported except the original R600. */
diff --git a/src/gallium/drivers/softpipe/sp_screen.c 
b/src/gallium/drivers/softpipe/sp_screen.c
index 24852a5..4851049 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -124,6 +124,8 @@ softpipe_get_param(struct pipe_screen *screen, enum 
pipe_cap param)
   return -8;
case PIPE_CAP_MAX_TEXEL_OFFSET:
   return 7;
+   case PIPE_CAP_CONDITIONAL_RENDER:
+  return 1;
default:
   return 0;
}
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index 950672c..d87c1a0 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -470,7 +470,8 @@ enum pipe_cap {
PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE = 48,
PIPE_CAP_SCALED_RESOLVE = 49,
PIPE_CAP_MIN_TEXEL_OFFSET = 50,
-   PIPE_CAP_MAX_TEXEL_OFFSET = 51
+   PIPE_CAP_MAX_TEXEL_OFFSET = 51,
+   PIPE_CAP_CONDITIONAL_RENDER = 52
 };
 
 /* Shader caps not specific to any single stage */
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h 
b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
index 6514146..2ab320a 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
@@ -150,7 +150,7 @@ struct GalliumD3D10Device : public 
GalliumD3D10ScreenImplthreadsafe
{
if(!pipe-begin_query)
caps.queries = false;
-   if(!pipe-render_condition)
+   if(!pipe-render_condition || !screen-get_param(screen, 
PIPE_CAP_CONDITIONAL_RENDER))

Mesa (master): gallium: add PIPE_CAP_TEXTURE_BARRIER

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: ba89086e79b22bd9578ea642846108de624c91e9
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba89086e79b22bd9578ea642846108de624c91e9

Author: Marek Olšák mar...@gmail.com
Date:   Tue Sep 27 23:18:17 2011 +0200

gallium: add PIPE_CAP_TEXTURE_BARRIER

Same issue as with conditional_render.

Reviewed-by: Brian Paul bri...@vmware.com

---

 src/gallium/drivers/nv50/nv50_screen.c |1 +
 src/gallium/drivers/nvc0/nvc0_screen.c |1 +
 src/gallium/drivers/r300/r300_screen.c |1 +
 src/gallium/drivers/r600/r600_pipe.c   |1 +
 src/gallium/include/pipe/p_defines.h   |3 ++-
 src/mesa/state_tracker/st_extensions.c |2 +-
 6 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_screen.c 
b/src/gallium/drivers/nv50/nv50_screen.c
index d3fdd55..c36f3cd 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -137,6 +137,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
case PIPE_CAP_CONDITIONAL_RENDER:
+   case PIPE_CAP_TEXTURE_BARRIER:
   return 1;
default:
   NOUVEAU_ERR(unknown PIPE_CAP %d\n, param);
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nvc0/nvc0_screen.c
index 9b97f24..cc6e683 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -125,6 +125,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
case PIPE_CAP_CONDITIONAL_RENDER:
+   case PIPE_CAP_TEXTURE_BARRIER:
   return 1;
default:
   NOUVEAU_ERR(unknown PIPE_CAP %d\n, param);
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 7699ed6..6a64a79 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -115,6 +115,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
 case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
 case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
 case PIPE_CAP_CONDITIONAL_RENDER:
+case PIPE_CAP_TEXTURE_BARRIER:
 return 1;
 
 /* r300 cannot do swizzling of compressed textures. Supported 
otherwise. */
diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index ec0d58a..efe1d52 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -360,6 +360,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL:
case PIPE_CAP_PRIMITIVE_RESTART:
case PIPE_CAP_CONDITIONAL_RENDER:
+   case PIPE_CAP_TEXTURE_BARRIER:
return 1;
 
/* Supported except the original R600. */
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index d87c1a0..acae4b1 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -471,7 +471,8 @@ enum pipe_cap {
PIPE_CAP_SCALED_RESOLVE = 49,
PIPE_CAP_MIN_TEXEL_OFFSET = 50,
PIPE_CAP_MAX_TEXEL_OFFSET = 51,
-   PIPE_CAP_CONDITIONAL_RENDER = 52
+   PIPE_CAP_CONDITIONAL_RENDER = 52,
+   PIPE_CAP_TEXTURE_BARRIER = 53
 };
 
 /* Shader caps not specific to any single stage */
diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index 7be3f40..8865440 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -611,7 +611,7 @@ void st_init_extensions(struct st_context *st)
   ctx-Extensions.ARB_sync = GL_TRUE;
}
 
-   if (st-pipe-texture_barrier) {
+   if (screen-get_param(screen, PIPE_CAP_TEXTURE_BARRIER)) {
   ctx-Extensions.NV_texture_barrier = GL_TRUE;
}
 

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


Mesa (master): r600g: merge r600_bo with r600_resource

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 6101b6d442b06a347c001fe85848d636ab7df260
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6101b6d442b06a347c001fe85848d636ab7df260

Author: Marek Olšák mar...@gmail.com
Date:   Sun Sep 11 22:24:38 2011 +0200

r600g: merge r600_bo with r600_resource

I have moved 'last_flush' and 'binding' from r600_bo to winsys/radeon.
The other members are now part of r600_resource.

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

---

 src/gallium/drivers/r600/evergreen_state.c |   41 ++
 src/gallium/drivers/r600/r600.h|   59 --
 src/gallium/drivers/r600/r600_asm.c|   12 +-
 src/gallium/drivers/r600/r600_buffer.c |   74 
 src/gallium/drivers/r600/r600_pipe.c   |   18 ++--
 src/gallium/drivers/r600/r600_pipe.h   |   15 ++-
 src/gallium/drivers/r600/r600_resource.h   |   11 --
 src/gallium/drivers/r600/r600_shader.c |   10 +-
 src/gallium/drivers/r600/r600_state.c  |   38 ++
 src/gallium/drivers/r600/r600_state_common.c   |   14 +-
 src/gallium/drivers/r600/r600_texture.c|   78 +++-
 src/gallium/winsys/r600/drm/Makefile.sources   |2 -
 src/gallium/winsys/r600/drm/evergreen_hw_context.c |7 +-
 src/gallium/winsys/r600/drm/r600_bo.c  |  131 
 src/gallium/winsys/r600/drm/r600_hw_context.c  |   83 +++--
 src/gallium/winsys/r600/drm/r600_priv.h|   18 +--
 src/gallium/winsys/radeon/drm/radeon_drm_bo.h  |4 +
 src/gallium/winsys/radeon/drm/radeon_winsys.h  |   10 ++-
 18 files changed, 243 insertions(+), 382 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=6101b6d442b06a347c001fe85848d636ab7df260
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): r600g: remove struct radeon (or what's left of it)

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 90ce3cdde9fb2dd507b4e21c5456a3371f5996bc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=90ce3cdde9fb2dd507b4e21c5456a3371f5996bc

Author: Marek Olšák mar...@gmail.com
Date:   Sat Sep 17 14:10:20 2011 +0200

r600g: remove struct radeon (or what's left of it)

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

---

 src/gallium/drivers/r600/r600.h|9 +---
 src/gallium/drivers/r600/r600_pipe.c   |   18 +--
 src/gallium/drivers/r600/r600_pipe.h   |2 -
 src/gallium/winsys/r600/drm/Makefile.sources   |1 -
 src/gallium/winsys/r600/drm/evergreen_hw_context.c |5 +-
 src/gallium/winsys/r600/drm/r600_drm.c |   49 
 src/gallium/winsys/r600/drm/r600_hw_context.c  |   20 
 src/gallium/winsys/r600/drm/r600_priv.h|   10 +---
 8 files changed, 18 insertions(+), 96 deletions(-)

diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h
index d7b979b..f35fb17 100644
--- a/src/gallium/drivers/r600/r600.h
+++ b/src/gallium/drivers/r600/r600.h
@@ -38,7 +38,6 @@ typedef uint32_t  u32;
 typedef uint16_t   u16;
 typedef uint8_tu8;
 
-struct radeon;
 struct winsys_handle;
 
 enum radeon_family {
@@ -203,7 +202,6 @@ struct r600_query {
 #define R600_CONTEXT_CHECK_EVENT_FLUSH (1  2)
 
 struct r600_context {
-   struct radeon   *radeon;
struct r600_screen  *screen;
struct radeon_winsys_cs *cs;
 
@@ -248,7 +246,7 @@ struct r600_draw {
 };
 
 void r600_get_backend_mask(struct r600_context *ctx);
-int r600_context_init(struct r600_context *ctx, struct r600_screen *screen, 
struct radeon *radeon);
+int r600_context_init(struct r600_context *ctx, struct r600_screen *screen);
 void r600_context_fini(struct r600_context *ctx);
 void r600_context_pipe_state_set(struct r600_context *ctx, struct 
r600_pipe_state *state);
 void r600_context_pipe_state_set_ps_resource(struct r600_context *ctx, struct 
r600_pipe_resource_state *state, unsigned rid);
@@ -275,7 +273,7 @@ void r600_context_emit_fence(struct r600_context *ctx, 
struct r600_resource *fen
 void r600_context_flush_all(struct r600_context *ctx, unsigned flush_flags);
 void r600_context_flush_dest_caches(struct r600_context *ctx);
 
-int evergreen_context_init(struct r600_context *ctx, struct r600_screen 
*screen, struct radeon *radeon);
+int evergreen_context_init(struct r600_context *ctx, struct r600_screen 
*screen);
 void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw 
*draw);
 void evergreen_context_flush_dest_caches(struct r600_context *ctx);
 void evergreen_context_pipe_state_set_ps_resource(struct r600_context *ctx, 
struct r600_pipe_resource_state *state, unsigned rid);
@@ -284,9 +282,6 @@ void evergreen_context_pipe_state_set_fs_resource(struct 
r600_context *ctx, stru
 void evergreen_context_pipe_state_set_ps_sampler(struct r600_context *ctx, 
struct r600_pipe_state *state, unsigned id);
 void evergreen_context_pipe_state_set_vs_sampler(struct r600_context *ctx, 
struct r600_pipe_state *state, unsigned id);
 
-struct radeon *radeon_create(struct radeon_winsys *ws);
-void radeon_destroy(struct radeon *radeon);
-
 void _r600_pipe_state_add_reg(struct r600_context *ctx,
  struct r600_pipe_state *state,
  u32 offset, u32 value, u32 mask,
diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index 3838c0f..73c2b33 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -213,7 +213,6 @@ static struct pipe_context *r600_create_context(struct 
pipe_screen *screen, void
/* Easy accessing of screen/winsys. */
rctx-screen = rscreen;
rctx-ws = rscreen-ws;
-   rctx-radeon = rscreen-radeon;
rctx-family = rscreen-family;
rctx-chip_class = rscreen-chip_class;
 
@@ -236,7 +235,7 @@ static struct pipe_context *r600_create_context(struct 
pipe_screen *screen, void
case R600:
case R700:
r600_init_state_functions(rctx);
-   if (r600_context_init(rctx-ctx, rctx-screen, rctx-radeon)) {
+   if (r600_context_init(rctx-ctx, rctx-screen)) {
r600_destroy_context(rctx-context);
return NULL;
}
@@ -246,7 +245,7 @@ static struct pipe_context *r600_create_context(struct 
pipe_screen *screen, void
case EVERGREEN:
case CAYMAN:
evergreen_init_state_functions(rctx);
-   if (evergreen_context_init(rctx-ctx, rctx-screen, 
rctx-radeon)) {
+   if (evergreen_context_init(rctx-ctx, rctx-screen)) {
r600_destroy_context(rctx-context);
return NULL;
}
@@ -524,7 +523,6 @@ static void r600_destroy_screen(struct pipe_screen* 

Mesa (master): winsys/radeon: move GEM domains out of the drivers into winsys

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 363ff844753c46ac9c13866627e096b091ea81f8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=363ff844753c46ac9c13866627e096b091ea81f8

Author: Marek Olšák mar...@gmail.com
Date:   Tue Sep 27 01:10:20 2011 +0200

winsys/radeon: move GEM domains out of the drivers into winsys

The drivers don't need to care about the domains. All they need to set
are the bind and usage flags. This simplifies the winsys too.

This also fixes on r600g:
- fbo-depth-GL_DEPTH_COMPONENT32F-copypixels
- fbo-depth-GL_DEPTH_COMPONENT16-copypixels
- fbo-depth-GL_DEPTH_COMPONENT24-copypixels
- fbo-depth-GL_DEPTH_COMPONENT32-copypixels
- fbo-depth-GL_DEPTH24_STENCIL8-copypixels
I can't explain it.

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

---

 src/gallium/drivers/r300/r300_context.h   |5 ---
 src/gallium/drivers/r300/r300_emit.c  |   18 +-
 src/gallium/drivers/r300/r300_flush.c |4 +-
 src/gallium/drivers/r300/r300_query.c |3 +-
 src/gallium/drivers/r300/r300_screen_buffer.c |4 +--
 src/gallium/drivers/r300/r300_texture.c   |   10 +-
 src/gallium/drivers/r300/r300_transfer.c  |8 -
 src/gallium/drivers/r600/r600.h   |3 --
 src/gallium/drivers/r600/r600_buffer.c|   30 +-
 src/gallium/drivers/r600/r600_texture.c   |2 -
 src/gallium/winsys/r600/drm/r600_priv.h   |8 +---
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c |   34 +--
 src/gallium/winsys/radeon/drm/radeon_drm_bo.h |3 ++
 src/gallium/winsys/radeon/drm/radeon_drm_cs.c |   43 -
 src/gallium/winsys/radeon/drm/radeon_winsys.h |   18 ++
 15 files changed, 82 insertions(+), 111 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.h 
b/src/gallium/drivers/r300/r300_context.h
index 8c8c7ce..d8638fc 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -295,8 +295,6 @@ struct r300_query {
 struct radeon_winsys_cs_handle *cs_buf;
 /* The size of the buffer. */
 unsigned buffer_size;
-/* The domain of the buffer. */
-enum radeon_bo_domain domain;
 
 /* Linked list members. */
 struct r300_query* prev;
@@ -310,8 +308,6 @@ struct r300_surface {
 struct pb_buffer *buf;
 struct radeon_winsys_cs_handle *cs_buf;
 
-enum radeon_bo_domain domain;
-
 uint32_t offset;/* COLOROFFSET or DEPTHOFFSET. */
 uint32_t pitch; /* COLORPITCH or DEPTHPITCH. */
 uint32_t pitch_zmask; /* ZMASK_PITCH */
@@ -395,7 +391,6 @@ struct r300_resource
 /* Winsys buffer backing this resource. */
 struct pb_buffer *buf;
 struct radeon_winsys_cs_handle *cs_buf;
-enum radeon_bo_domain domain;
 
 /* Constant buffers are in user memory. */
 uint8_t *constant_buffer;
diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 62dcbf6..2fb448a 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -1189,15 +1189,15 @@ validate:
 for (i = 0; i  fb-nr_cbufs; i++) {
 tex = r300_resource(fb-cbufs[i]-texture);
 assert(tex  tex-buf  cbuf is marked, but NULL!);
-r300-rws-cs_add_reloc(r300-cs, tex-cs_buf, 0,
-r300_surface(fb-cbufs[i])-domain);
+r300-rws-cs_add_reloc(r300-cs, tex-cs_buf,
+RADEON_USAGE_READWRITE);
 }
 /* ...depth buffer... */
 if (fb-zsbuf) {
 tex = r300_resource(fb-zsbuf-texture);
 assert(tex  tex-buf  zsbuf is marked, but NULL!);
-r300-rws-cs_add_reloc(r300-cs, tex-cs_buf, 0,
-r300_surface(fb-zsbuf)-domain);
+r300-rws-cs_add_reloc(r300-cs, tex-cs_buf,
+RADEON_USAGE_READWRITE);
 }
 }
 if (r300-textures_state.dirty) {
@@ -1208,17 +1208,17 @@ validate:
 }
 
 tex = r300_resource(texstate-sampler_views[i]-base.texture);
-r300-rws-cs_add_reloc(r300-cs, tex-cs_buf, tex-domain, 0);
+r300-rws-cs_add_reloc(r300-cs, tex-cs_buf, RADEON_USAGE_READ);
 }
 }
 /* ...occlusion query buffer... */
 if (r300-query_current)
 r300-rws-cs_add_reloc(r300-cs, r300-query_current-cs_buf,
-0, r300-query_current-domain);
+RADEON_USAGE_WRITE);
 /* ...vertex buffer for SWTCL path... */
 if (r300-vbo)
 r300-rws-cs_add_reloc(r300-cs, r300_resource(r300-vbo)-cs_buf,
-r300_resource(r300-vbo)-domain, 0);
+RADEON_USAGE_READ);
 /* ...vertex buffers for HWTCL path... */
 if (do_validate_vertex_buffers  r300-vertex_arrays_dirty) {
 struct pipe_vertex_buffer *vbuf = r300-vbuf_mgr-real_vertex_buffer;
@@ 

Mesa (master): r600g: move all files from winsys/r600 into drivers/r600

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: bf0baa771709e1076613cf9f9bed6ac004dd0439
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf0baa771709e1076613cf9f9bed6ac004dd0439

Author: Marek Olšák mar...@gmail.com
Date:   Tue Sep 27 16:42:01 2011 +0200

r600g: move all files from winsys/r600 into drivers/r600

Be sure to reconfigure after this commit.

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

---

 Android.mk |2 +-
 configure.ac   |2 +-
 src/gallium/Android.mk |2 +-
 src/gallium/drivers/r600/Makefile.sources  |2 +
 .../drm = drivers/r600}/evergreen_hw_context.c|2 +-
 .../r600/drm = drivers/r600}/r600_hw_context.c|2 +-
 .../r600/r600_hw_context_priv.h}   |0 
 src/gallium/targets/dri-r600/Makefile  |1 -
 src/gallium/targets/dri-r600/SConscript|1 -
 src/gallium/targets/egl-static/Makefile|5 +-
 src/gallium/targets/egl-static/SConscript  |1 -
 src/gallium/targets/gbm/Makefile   |5 +-
 src/gallium/targets/va-r600/Makefile   |1 -
 src/gallium/targets/vdpau-r600/Makefile|1 -
 src/gallium/targets/xorg-r600/Makefile |1 -
 src/gallium/targets/xvmc-r600/Makefile |1 -
 src/gallium/winsys/SConscript  |4 --
 src/gallium/winsys/r600/drm/Android.mk |   41 
 src/gallium/winsys/r600/drm/Makefile   |   15 ---
 src/gallium/winsys/r600/drm/Makefile.sources   |3 -
 src/gallium/winsys/r600/drm/SConscript |   14 ---
 21 files changed, 13 insertions(+), 93 deletions(-)

diff --git a/Android.mk b/Android.mk
index a5c9ebc..29453bc 100644
--- a/Android.mk
+++ b/Android.mk
@@ -149,7 +149,7 @@ ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
 gallium_DRIVERS += libmesa_pipe_r300
 endif
 ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
-gallium_DRIVERS += libmesa_pipe_r600 libmesa_winsys_r600
+gallium_DRIVERS += libmesa_pipe_r600
 endif
 endif
 
diff --git a/configure.ac b/configure.ac
index 2042653..49e81ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1824,7 +1824,7 @@ if test x$with_gallium_drivers != x; then
 ;;
 xr600)
 GALLIUM_DRIVERS_DIRS=$GALLIUM_DRIVERS_DIRS r600
-gallium_check_st r600/drm radeon/drm dri-r600 xorg-r600  
xvmc-r600 vdpau-r600 va-r600
+gallium_check_st radeon/drm dri-r600 xorg-r600  
xvmc-r600 vdpau-r600 va-r600
 ;;
 xnouveau)
 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau = 
$LIBDRM_NOUVEAU_REQUIRED])
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 3deb94b..41c59b1 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -56,7 +56,7 @@ ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
 SUBDIRS += drivers/r300
 endif
 ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
-SUBDIRS += winsys/r600/drm drivers/r600
+SUBDIRS += drivers/r600
 endif
 endif
 
diff --git a/src/gallium/drivers/r600/Makefile.sources 
b/src/gallium/drivers/r600/Makefile.sources
index 0366394..e7813ef 100644
--- a/src/gallium/drivers/r600/Makefile.sources
+++ b/src/gallium/drivers/r600/Makefile.sources
@@ -2,6 +2,7 @@ C_SOURCES := \
r600_asm.c \
r600_blit.c \
r600_buffer.c \
+   r600_hw_context.c \
r600_pipe.c \
r600_query.c \
r600_resource.c \
@@ -9,6 +10,7 @@ C_SOURCES := \
r600_state.c \
r600_texture.c \
r700_asm.c \
+   evergreen_hw_context.c \
evergreen_state.c \
eg_asm.c \
r600_translate.c \
diff --git a/src/gallium/winsys/r600/drm/evergreen_hw_context.c 
b/src/gallium/drivers/r600/evergreen_hw_context.c
similarity index 99%
rename from src/gallium/winsys/r600/drm/evergreen_hw_context.c
rename to src/gallium/drivers/r600/evergreen_hw_context.c
index c83560e..3779dd4 100644
--- a/src/gallium/winsys/r600/drm/evergreen_hw_context.c
+++ b/src/gallium/drivers/r600/evergreen_hw_context.c
@@ -24,7 +24,7 @@
  *  Jerome Glisse
  */
 #include r600.h
-#include r600_priv.h
+#include r600_hw_context_priv.h
 #include r600_pipe.h
 #include evergreend.h
 #include util/u_memory.h
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c 
b/src/gallium/drivers/r600/r600_hw_context.c
similarity index 99%
rename from src/gallium/winsys/r600/drm/r600_hw_context.c
rename to src/gallium/drivers/r600/r600_hw_context.c
index fa7a8b6..d261e2a 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -23,7 +23,7 @@
  * Authors:
  *  Jerome Glisse
  */
-#include r600_priv.h
+#include r600_hw_context_priv.h
 #include r600_pipe.h
 #include r600d.h
 #include util/u_memory.h
diff --git a/src/gallium/winsys/r600/drm/r600_priv.h 
b/src/gallium/drivers/r600/r600_hw_context_priv.h
similarity index 

Mesa (master): winsys/radeon: remove a redundant parameter 'size' from buffer_from_handle

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: af8eb5c851a9d566059ae9e37745614cd96b9a13
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=af8eb5c851a9d566059ae9e37745614cd96b9a13

Author: Marek Olšák mar...@gmail.com
Date:   Tue Sep 27 02:08:15 2011 +0200

winsys/radeon: remove a redundant parameter 'size' from buffer_from_handle

It's part of pb_buffer already.

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

---

 src/gallium/drivers/r300/r300_texture.c   |2 +-
 src/gallium/drivers/r600/r600_texture.c   |2 +-
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c |7 ++-
 src/gallium/winsys/radeon/drm/radeon_winsys.h |4 +---
 4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_texture.c 
b/src/gallium/drivers/r300/r300_texture.c
index d2b3f3c..067ec07 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -969,7 +969,7 @@ struct pipe_resource *r300_texture_from_handle(struct 
pipe_screen *screen,
 return NULL;
 }
 
-buffer = rws-buffer_from_handle(rws, whandle, stride, NULL);
+buffer = rws-buffer_from_handle(rws, whandle, stride);
 if (!buffer)
 return NULL;
 
diff --git a/src/gallium/drivers/r600/r600_texture.c 
b/src/gallium/drivers/r600/r600_texture.c
index 99eb1aa..bbda2cb 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -555,7 +555,7 @@ struct pipe_resource *r600_texture_from_handle(struct 
pipe_screen *screen,
  templ-depth0 != 1 || templ-last_level != 0)
return NULL;
 
-   buf = rscreen-ws-buffer_from_handle(rscreen-ws, whandle, stride, 
NULL);
+   buf = rscreen-ws-buffer_from_handle(rscreen-ws, whandle, stride);
if (!buf)
return NULL;
 
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c 
b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 6a8dabf..20139b4 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -533,9 +533,8 @@ radeon_winsys_bo_create(struct radeon_winsys *rws,
 }
 
 static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys 
*rws,
-   struct 
winsys_handle *whandle,
-   unsigned *stride,
-   unsigned *size)
+  struct winsys_handle 
*whandle,
+  unsigned *stride)
 {
 struct radeon_drm_winsys *ws = radeon_drm_winsys(rws);
 struct radeon_bo *bo;
@@ -591,8 +590,6 @@ done:
 
 if (stride)
 *stride = whandle-stride;
-if (size)
-*size = bo-base.size;
 
 return (struct pb_buffer*)bo;
 
diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h 
b/src/gallium/winsys/radeon/drm/radeon_winsys.h
index b92dad8..31d39e9 100644
--- a/src/gallium/winsys/radeon/drm/radeon_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h
@@ -230,12 +230,10 @@ struct radeon_winsys {
  * \param whandle   A winsys handle pointer as was received from a state
  *  tracker.
  * \param strideThe returned buffer stride in bytes.
- * \param size  The returned buffer size.
  */
 struct pb_buffer *(*buffer_from_handle)(struct radeon_winsys *ws,
 struct winsys_handle *whandle,
-unsigned *stride,
-unsigned *size);
+unsigned *stride);
 
 /**
  * Get a winsys handle from a winsys buffer. The internal structure

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


Mesa (master): gallium/docs: update the documentation of capabilities

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 74d6f929b45c7f2cca8af227ba8dc259b528c4c0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=74d6f929b45c7f2cca8af227ba8dc259b528c4c0

Author: Marek Olšák mar...@gmail.com
Date:   Fri Sep 30 23:02:06 2011 +0200

gallium/docs: update the documentation of capabilities

Still like 13 caps are undocumented.

---

 src/gallium/docs/source/screen.rst |  157 +++-
 1 files changed, 84 insertions(+), 73 deletions(-)

diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 976e75b..924858e 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -22,75 +22,49 @@ or integer values, use :ref:`get_param`.
 
 The integer capabilities:
 
-* ``MAX_TEXTURE_IMAGE_UNITS``: The maximum number of samplers available.
-* ``NPOT_TEXTURES``: Whether :term:`NPOT` textures may have repeat modes,
+* ``PIPE_CAP_NPOT_TEXTURES``: Whether :term:`NPOT` textures may have repeat 
modes,
   normalized coordinates, and mipmaps.
-* ``TWO_SIDED_STENCIL``: Whether the stencil test can also affect back-facing
+* ``PIPE_CAP_TWO_SIDED_STENCIL``: Whether the stencil test can also affect 
back-facing
   polygons.
-* ``GLSL``: Deprecated.
-* ``DUAL_SOURCE_BLEND``: Whether dual-source blend factors are supported. See
+* ``PIPE_CAP_GLSL``: Deprecated.
+* ``PIPE_CAP_DUAL_SOURCE_BLEND``: Whether dual-source blend factors are 
supported. See
   :ref:`Blend` for more information.
-* ``ANISOTROPIC_FILTER``: Whether textures can be filtered anisotropically.
-* ``POINT_SPRITE``: Whether point sprites are available.
-* ``MAX_RENDER_TARGETS``: The maximum number of render targets that may be
+* ``PIPE_CAP_ANISOTROPIC_FILTER``: Whether textures can be filtered 
anisotropically.
+* ``PIPE_CAP_POINT_SPRITE``: Whether point sprites are available.
+* ``PIPE_CAP_MAX_RENDER_TARGETS``: The maximum number of render targets that 
may be
   bound.
-* ``OCCLUSION_QUERY``: Whether occlusion queries are available.
-* ``TIMER_QUERY``: Whether timer queries are available.
-* ``INSTANCED_DRAWING``: indicates support for instanced drawing.
-* ``TEXTURE_SHADOW_MAP``: indicates whether the fragment shader hardware
+* ``PIPE_CAP_OCCLUSION_QUERY``: Whether occlusion queries are available.
+* ``PIPE_CAP_TIMER_QUERY``: Whether timer queries are available.
+* ``PIPE_CAP_TEXTURE_SHADOW_MAP``: indicates whether the fragment shader 
hardware
   can do the depth texture / Z comparison operation in TEX instructions
   for shadow testing.
-* ``MAX_TEXTURE_2D_LEVELS``: The maximum number of mipmap levels available
+* ``PIPE_CAP_TEXTURE_SWIZZLE``: Whether swizzling through sampler views is
+  supported.
+* ``PIPE_CAP_MAX_TEXTURE_2D_LEVELS``: The maximum number of mipmap levels 
available
   for a 2D texture.
-* ``MAX_TEXTURE_3D_LEVELS``: The maximum number of mipmap levels available
+* ``PIPE_CAP_MAX_TEXTURE_3D_LEVELS``: The maximum number of mipmap levels 
available
   for a 3D texture.
-* ``MAX_TEXTURE_CUBE_LEVELS``: The maximum number of mipmap levels available
+* ``PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS``: The maximum number of mipmap levels 
available
   for a cubemap.
-* ``TEXTURE_MIRROR_CLAMP``: Whether mirrored texture coordinates with clamp
+* ``PIPE_CAP_TEXTURE_MIRROR_CLAMP``: Whether mirrored texture coordinates with 
clamp
   are supported.
-* ``TEXTURE_MIRROR_REPEAT``: Whether mirrored repeating texture coordinates
-  are supported.
-* ``MAX_VERTEX_TEXTURE_UNITS``: The maximum number of samplers addressable
-  inside the vertex shader. If this is 0, then the vertex shader cannot
-  sample textures.
-* ``TGSI_CONT_SUPPORTED``: Whether the TGSI CONT opcode is supported.
-* ``BLEND_EQUATION_SEPARATE``: Whether alpha blend equations may be different
+* ``PIPE_CAP_BLEND_EQUATION_SEPARATE``: Whether alpha blend equations may be 
different
   from color blend equations, in :ref:`Blend` state.
-* ``SM3``: Whether the vertex shader and fragment shader support equivalent
+* ``PIPE_CAP_SM3``: Whether the vertex shader and fragment shader support 
equivalent
   opcodes to the Shader Model 3 specification. XXX oh god this is horrible
-* ``MAX_PREDICATE_REGISTERS``: indicates the number of predicate registers
-  available.  Predicate register may be set as a side-effect of ALU
-  instructions to indicate less than, greater than or equal to zero.
-  Later instructions can use a predicate register to control writing to
-  each channel of destination registers.  NOTE: predicate registers have
-  not been fully implemented in Gallium at this time.  See the
-  GL_NV_fragment_program extension for more info (look for condition codes).
-* ``MAX_COMBINED_SAMPLERS``: The total number of samplers accessible from
+* ``PIPE_CAP_MAX_COMBINED_SAMPLERS``: The total number of samplers accessible 
from
   the vertex and fragment shader, inclusive.
-* ``MAX_CONST_BUFFERS``: Maximum number of constant buffers that can be bound
-  to any shader stage using 

Mesa (master): r600g: fix a compiler warning

2011-09-30 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: aae342cff098034b6f685a81ecb4cd5e3fa92162
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aae342cff098034b6f685a81ecb4cd5e3fa92162

Author: Marek Olšák mar...@gmail.com
Date:   Fri Sep 30 23:06:51 2011 +0200

r600g: fix a compiler warning

---

 src/gallium/drivers/r600/r600_hw_context.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_hw_context.c 
b/src/gallium/drivers/r600/r600_hw_context.c
index d261e2a..9d6b053 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -1617,6 +1617,7 @@ void r600_query_begin(struct r600_context *ctx, struct 
r600_query *query)
break;
default:
assert(0);
+   return;
}
 
if ((required_space + ctx-pm4_cdwords)  ctx-pm4_ndwords) {

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


Mesa (master): mesa: Use Add linker_error instead of fail_link

2011-09-30 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: a9f25160af9c12cdd675819a74fb7b1a92cfce34
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9f25160af9c12cdd675819a74fb7b1a92cfce34

Author: Ian Romanick ian.d.roman...@intel.com
Date:   Thu Sep 22 16:56:58 2011 -0700

mesa: Use Add linker_error instead of fail_link

See also 8aadd89.

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

---

 src/mesa/program/sampler.cpp |   17 +++--
 1 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/mesa/program/sampler.cpp b/src/mesa/program/sampler.cpp
index e8d34c6..3b459d5 100644
--- a/src/mesa/program/sampler.cpp
+++ b/src/mesa/program/sampler.cpp
@@ -26,6 +26,7 @@
 #include ir.h
 #include glsl_types.h
 #include ir_visitor.h
+#include ../glsl/program.h
 
 extern C {
 #include main/compiler.h
@@ -33,18 +34,6 @@ extern C {
 #include program/prog_parameter.h
 }
 
-static void fail_link(struct gl_shader_program *prog, const char *fmt, ...) 
PRINTFLIKE(2, 3);
-
-static void fail_link(struct gl_shader_program *prog, const char *fmt, ...)
-{
-   va_list args;
-   va_start(args, fmt);
-   ralloc_vasprintf_append(prog-InfoLog, fmt, args);
-   va_end(args);
-
-   prog-LinkStatus = GL_FALSE;
-}
-
 class get_sampler_name : public ir_hierarchical_visitor
 {
 public:
@@ -125,8 +114,8 @@ _mesa_get_sampler_uniform_value(class ir_dereference 
*sampler,
  getname.name);
 
if (index  0) {
-  fail_link(shader_program,
-   failed to find sampler named %s.\n, getname.name);
+  linker_error(shader_program,
+  failed to find sampler named %s.\n, getname.name);
   return 0;
}
 

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


Mesa (master): mesa: Remove unused field gl_program::Varying

2011-09-30 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: cd76f114e608ffb93a03ac3ffc3e11876d6a057e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd76f114e608ffb93a03ac3ffc3e11876d6a057e

Author: Ian Romanick ian.d.roman...@intel.com
Date:   Tue Aug 16 11:06:54 2011 -0700

mesa: Remove unused field gl_program::Varying

Lots of things set and copy this field around, but nothing uses it.

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

---

 src/mesa/main/mtypes.h |2 --
 src/mesa/program/ir_to_mesa.cpp|2 --
 src/mesa/program/program.c |5 -
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |3 ---
 4 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index be43434..70f33ff 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1834,8 +1834,6 @@ struct gl_program
/** Numbered local parameters */
GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
 
-   /** Vertex/fragment shader varying vars */
-   struct gl_program_parameter_list *Varying;
/** Vertex program user-defined attributes */
struct gl_program_parameter_list *Attributes;
 
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index c5b71b3..5992e20 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -3045,7 +3045,6 @@ get_mesa_program(struct gl_context *ctx,
if (!prog)
   return NULL;
prog-Parameters = _mesa_new_parameter_list();
-   prog-Varying = _mesa_new_parameter_list();
prog-Attributes = _mesa_new_parameter_list();
v.ctx = ctx;
v.prog = prog;
@@ -3434,7 +3433,6 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct 
gl_shader_program *prog)
   }
}
 
-   prog-Varying = _mesa_new_parameter_list();
_mesa_reference_vertprog(ctx, prog-VertexProgram, NULL);
_mesa_reference_fragprog(ctx, prog-FragmentProgram, NULL);
_mesa_reference_geomprog(ctx, prog-GeometryProgram, NULL);
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index ecff234..bdab304 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -394,9 +394,6 @@ _mesa_delete_program(struct gl_context *ctx, struct 
gl_program *prog)
if (prog-Parameters) {
   _mesa_free_parameter_list(prog-Parameters);
}
-   if (prog-Varying) {
-  _mesa_free_parameter_list(prog-Varying);
-   }
if (prog-Attributes) {
   _mesa_free_parameter_list(prog-Attributes);
}
@@ -522,8 +519,6 @@ _mesa_clone_program(struct gl_context *ctx, const struct 
gl_program *prog)
if (prog-Parameters)
   clone-Parameters = _mesa_clone_parameter_list(prog-Parameters);
memcpy(clone-LocalParams, prog-LocalParams, sizeof(clone-LocalParams));
-   if (prog-Varying)
-  clone-Varying = _mesa_clone_parameter_list(prog-Varying);
if (prog-Attributes)
   clone-Attributes = _mesa_clone_parameter_list(prog-Attributes);
memcpy(clone-LocalParams, prog-LocalParams, sizeof(clone-LocalParams));
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index f68270d..b8ca2c1 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3987,7 +3987,6 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
prog-Parameters = _mesa_combine_parameter_lists(params,
 
original-prog-Parameters);
prog-Attributes = _mesa_clone_parameter_list(original-prog-Attributes);
-   prog-Varying = _mesa_clone_parameter_list(original-prog-Varying);
_mesa_free_parameter_list(params);
count_resources(v, prog);
fp-glsl_to_tgsi = v;
@@ -4063,7 +4062,6 @@ get_bitmap_visitor(struct st_fragment_program *fp,
/* Make modifications to fragment program info. */
prog-Parameters = _mesa_clone_parameter_list(original-prog-Parameters);
prog-Attributes = _mesa_clone_parameter_list(original-prog-Attributes);
-   prog-Varying = _mesa_clone_parameter_list(original-prog-Varying);
count_resources(v, prog);
fp-glsl_to_tgsi = v;
 }
@@ -4969,7 +4967,6 @@ get_mesa_program(struct gl_context *ctx,
if (!prog)
   return NULL;
prog-Parameters = _mesa_new_parameter_list();
-   prog-Varying = _mesa_new_parameter_list();
prog-Attributes = _mesa_new_parameter_list();
v-ctx = ctx;
v-prog = prog;

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


Mesa (master): mesa: Document an odd side-effect of hash_table_insert

2011-09-30 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: 16f7bdf5556e739d5a0b6c4c2e2a30bb731f8fc9
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=16f7bdf5556e739d5a0b6c4c2e2a30bb731f8fc9

Author: Ian Romanick ian.d.roman...@intel.com
Date:   Wed Aug 17 11:43:11 2011 -0700

mesa: Document an odd side-effect of hash_table_insert

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

---

 src/mesa/program/hash_table.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/hash_table.h b/src/mesa/program/hash_table.h
index e715bb1..746939c 100644
--- a/src/mesa/program/hash_table.h
+++ b/src/mesa/program/hash_table.h
@@ -88,6 +88,11 @@ extern void *hash_table_find(struct hash_table *ht, const 
void *key);
 
 /**
  * Add an element to a hash table
+ *
+ * \warning
+ * If \c key is already in the hash table, it will be added again.  Future
+ * calls to \c hash_table_find and \c hash_table_remove will return or remove,
+ * repsectively, the most recently added instance of \c key.
  */
 extern void hash_table_insert(struct hash_table *ht, void *data,
 const void *key);

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


Mesa (master): mesa: Refactor hash_table_{find, remove} to share some code

2011-09-30 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: 1f8f8aef7f30156bbd906be36cdda2e05d8b0a7f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f8f8aef7f30156bbd906be36cdda2e05d8b0a7f

Author: Ian Romanick ian.d.roman...@intel.com
Date:   Wed Aug 17 11:48:07 2011 -0700

mesa: Refactor hash_table_{find,remove} to share some code

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

---

 src/mesa/program/hash_table.c |   32 
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/mesa/program/hash_table.c b/src/mesa/program/hash_table.c
index 877a9e2..2b09462 100644
--- a/src/mesa/program/hash_table.c
+++ b/src/mesa/program/hash_table.c
@@ -108,8 +108,8 @@ hash_table_clear(struct hash_table *ht)
 }
 
 
-void *
-hash_table_find(struct hash_table *ht, const void *key)
+static struct hash_node *
+get_node(struct hash_table *ht, const void *key)
 {
 const unsigned hash_value = (*ht-hash)(key);
 const unsigned bucket = hash_value % ht-num_buckets;
@@ -119,13 +119,20 @@ hash_table_find(struct hash_table *ht, const void *key)
struct hash_node *hn = (struct hash_node *) node;
 
if ((*ht-compare)(hn-key, key) == 0) {
- return hn-data;
+ return hn;
}
 }
 
 return NULL;
 }
 
+void *
+hash_table_find(struct hash_table *ht, const void *key)
+{
+   struct hash_node *hn = get_node(ht, key);
+
+   return (hn == NULL) ? NULL : hn-data;
+}
 
 void
 hash_table_insert(struct hash_table *ht, void *data, const void *key)
@@ -145,19 +152,12 @@ hash_table_insert(struct hash_table *ht, void *data, 
const void *key)
 void
 hash_table_remove(struct hash_table *ht, const void *key)
 {
-const unsigned hash_value = (*ht-hash)(key);
-const unsigned bucket = hash_value % ht-num_buckets;
-struct node *node;
-
-foreach(node,  ht-buckets[bucket]) {
-   struct hash_node *hn = (struct hash_node *) node;
-
-   if ((*ht-compare)(hn-key, key) == 0) {
- remove_from_list(node);
- free(node);
- return;
-   }
-}
+   struct node *node = (struct node *) get_node(ht, key);
+   if (node != NULL) {
+  remove_from_list(node);
+  free(node);
+  return;
+   }
 }
 
 void

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