Mesa (master): glu/sgi: Initialize members of class Curvelist.

2010-02-13 Thread Vinson Lee
Module: Mesa
Branch: master
Commit: ec5e54a40a26e098313afd4d435e012b4b43b320
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec5e54a40a26e098313afd4d435e012b4b43b320

Author: Vinson Lee 
Date:   Sat Feb 13 23:56:48 2010 -0800

glu/sgi: Initialize members of class Curvelist.

---

 src/glu/sgi/libnurbs/internals/curvelist.cc |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/glu/sgi/libnurbs/internals/curvelist.cc 
b/src/glu/sgi/libnurbs/internals/curvelist.cc
index abfebb7..da04eff 100644
--- a/src/glu/sgi/libnurbs/internals/curvelist.cc
+++ b/src/glu/sgi/libnurbs/internals/curvelist.cc
@@ -53,6 +53,8 @@ Curvelist::Curvelist( Quilt *quilts, REAL pta, REAL ptb )
 range[0] = pta;
 range[1] = ptb;
 range[2] = ptb - pta;
+needsSubdivision = 0;
+stepsize = 0;
 }
 
 Curvelist::Curvelist( Curvelist &upper, REAL value )

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


Mesa (master): llvmpipe: Silence uninitialized variable warning.

2010-02-13 Thread Vinson Lee
Module: Mesa
Branch: master
Commit: 1462c1299c52c09a0fc5251067af75ae0192b9ea
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1462c1299c52c09a0fc5251067af75ae0192b9ea

Author: Vinson Lee 
Date:   Sat Feb 13 23:48:40 2010 -0800

llvmpipe: Silence uninitialized variable warning.

---

 src/gallium/drivers/llvmpipe/lp_scene_queue.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_scene_queue.c 
b/src/gallium/drivers/llvmpipe/lp_scene_queue.c
index 43d74e4..975db43 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene_queue.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene_queue.c
@@ -92,6 +92,8 @@ lp_scene_dequeue(struct lp_scene_queue *queue, boolean wait)
struct scene_packet packet;
enum pipe_error ret;
 
+   packet.scene = NULL;
+
ret = util_ringbuffer_dequeue(queue->ring,
  &packet.header,
  sizeof packet / 4,

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


Mesa (master): softpipe: Silence uninitialized variable warnings.

2010-02-13 Thread Vinson Lee
Module: Mesa
Branch: master
Commit: 71e750f4822a1cdba24abf1fc48eabeeb77961f8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=71e750f4822a1cdba24abf1fc48eabeeb77961f8

Author: Vinson Lee 
Date:   Sat Feb 13 22:51:34 2010 -0800

softpipe: Silence uninitialized variable warnings.

---

 src/gallium/drivers/softpipe/sp_tex_sample.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c 
b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 824d8d1..ecd6b39 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1682,6 +1682,9 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
  break;
   default:
  assert(0 && "bad cube face");
+ sc = 0.0F;
+ tc = 0.0F;
+ ma = 0.0F;
   }
 
   {

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


Mesa (master): st/python: fix build error after gallium-screen-context merge

2010-02-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 260ec80f11561f2f9dbb2000d3e72b54b0fe91a5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=260ec80f11561f2f9dbb2000d3e72b54b0fe91a5

Author: Marek Olšák 
Date:   Sun Feb 14 03:16:00 2010 +0100

st/python: fix build error after gallium-screen-context merge

---

 src/gallium/state_trackers/python/st_device.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/python/st_device.c 
b/src/gallium/state_trackers/python/st_device.c
index 1146a8b..a3798a5 100644
--- a/src/gallium/state_trackers/python/st_device.c
+++ b/src/gallium/state_trackers/python/st_device.c
@@ -157,7 +157,7 @@ st_context_create(struct st_device *st_dev)

st_device_reference(&st_ctx->st_dev, st_dev);

-   st_ctx->pipe = st_dev->screen->create_context(st_dev->screen, NULL);
+   st_ctx->pipe = st_dev->screen->context_create(st_dev->screen, NULL);
if(!st_ctx->pipe) {
   st_context_destroy(st_ctx);
   return NULL;

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


Mesa (master): r300g: fix scons build

2010-02-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 804a6d6a684e2a95e8b84c723a4096243c4fde1a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=804a6d6a684e2a95e8b84c723a4096243c4fde1a

Author: Marek Olšák 
Date:   Sun Feb 14 03:14:32 2010 +0100

r300g: fix scons build

---

 src/gallium/drivers/r300/r300_context.c |3 ++-
 src/gallium/drivers/r300/r300_winsys.h  |3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c 
b/src/gallium/drivers/r300/r300_context.c
index 14820ca..f631b4e 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -34,7 +34,8 @@
 #include "r300_screen.h"
 #include "r300_state_invariant.h"
 #include "r300_texture.h"
-#include "r300_winsys.h"
+
+#include "radeon_winsys.h"
 
 static void r300_destroy_context(struct pipe_context* context)
 {
diff --git a/src/gallium/drivers/r300/r300_winsys.h 
b/src/gallium/drivers/r300/r300_winsys.h
index f4a8ae1..40fb8a9 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -33,9 +33,8 @@ extern "C" {
 
 #include "pipe/p_defines.h"
 #include "pipe/p_state.h"
-#include "util/u_simple_screen.h"
 
-#include "radeon_winsys.h"
+struct radeon_winsys;
 
 /* Creates a new r300 screen. */
 struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys);

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


Mesa (master): softpipe: fix broken cubemap / mipmap selection code

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 85425b3b609c480cd024b217b1efd0b9153bed58
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=85425b3b609c480cd024b217b1efd0b9153bed58

Author: Brian Paul 
Date:   Sat Feb 13 17:47:23 2010 -0700

softpipe: fix broken cubemap / mipmap selection code

This is a quick-fix for the time being...

The per-face mipmap LOD computation was invalid at cube edges.  In
mip_filter_nearest/linear() we were trying to compute LOD using
texcoords that were sometimes indexes into different cube faces.
The subtraction used to compute the partial derivatives basically
gave random values, so the LOD was unpredictable.  This fix simply
uses the same cube face for all four pixels in the quad.  The per-
face texcoords all reference the same cube face so the partial
deriviates are computed properly.

A more elaborate fix would involve computing the LOD at the same
time as we choose the cube faces.  But for now, this solution works
well and allows the piglit/cubemap test to pass.

(cherry picked from commit 1ff9cd5079b095d7050edb8dc6a7e5b8cad36e1e)

---

 src/gallium/drivers/softpipe/sp_tex_sample.c |   99 ++---
 1 files changed, 71 insertions(+), 28 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c 
b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 473ec3e..824d8d1 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1327,6 +1327,11 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler,
 }
 
 
+/**
+ * Compute nearest mipmap level from texcoords.
+ * Then sample the texture level for four elements of a quad.
+ * \param c0  the LOD bias factors, or absolute LODs (depending on control)
+ */
 static void
 mip_filter_nearest(struct tgsi_sampler *tgsi_sampler,
const float s[QUAD_SIZE],
@@ -1563,8 +1568,8 @@ sample_compare(struct tgsi_sampler *tgsi_sampler,
 
 
 /**
- * Compute which cube face is referenced by each texcoord and put that
- * info into the sampler faces[] array.  Then sample the cube faces
+ * Use 3D texcoords to choose a cube face, then sample the 2D cube faces.
+ * Put face info into the sampler faces[] array.
  */
 static void
 sample_cube(struct tgsi_sampler *tgsi_sampler,
@@ -1578,11 +1583,12 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
unsigned j;
float [4], [4];
+   unsigned face;
 
/*
  major axis
- direction target sc tcma
- -----------   ---
+ directiontarget sc tcma
+ --   ---------   ---
  +rx  TEXTURE_CUBE_MAP_POSITIVE_X_EXT-rz-ry   rx
  -rx  TEXTURE_CUBE_MAP_NEGATIVE_X_EXT+rz-ry   rx
  +ry  TEXTURE_CUBE_MAP_POSITIVE_Y_EXT+rx+rz   ry
@@ -1590,56 +1596,93 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
  +rz  TEXTURE_CUBE_MAP_POSITIVE_Z_EXT+rx-ry   rz
  -rz  TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT-rx-ry   rz
*/
-   for (j = 0; j < QUAD_SIZE; j++) {
-  float rx = s[j];
-  float ry = t[j];
-  float rz = p[j];
+
+   /* First choose the cube face.
+* Use the same cube face for all four pixels in the quad.
+*
+* This isn't ideal, but if we want to use a different cube face
+* per pixel in the quad, we'd have to also compute the per-face
+* LOD here too.  That's because the four post-face-selection
+* texcoords are no longer related to each other (they're
+* per-face!)  so we can't use subtraction to compute the partial
+* deriviates to compute the LOD.  Doing so (near cube edges
+* anyway) gives us pretty much random values.
+*/
+   {
+  /* use the average of the four pixel's texcoords to choose the face */
+  const float rx = 0.25 * (s[0] + s[1] + s[2] + s[3]);
+  const float ry = 0.25 * (t[0] + t[1] + t[2] + t[3]);
+  const float rz = 0.25 * (p[0] + p[1] + p[2] + p[3]);
   const float arx = fabsf(rx), ary = fabsf(ry), arz = fabsf(rz);
-  unsigned face;
-  float sc, tc, ma;
 
   if (arx >= ary && arx >= arz) {
  if (rx >= 0.0F) {
 face = PIPE_TEX_FACE_POS_X;
-sc = -rz;
-tc = -ry;
-ma = arx;
  }
  else {
 face = PIPE_TEX_FACE_NEG_X;
-sc = rz;
-tc = -ry;
-ma = arx;
  }
   }
   else if (ary >= arx && ary >= arz) {
  if (ry >= 0.0F) {
 face = PIPE_TEX_FACE_POS_Y;
-sc = rx;
-tc = rz;
-ma = ary;
  }
  else {
 face = PIPE_TEX_FACE_NEG_Y;
-sc = rx;
-tc = -rz;
-ma = ary;
  }
   }
   else {
  if (rz > 0.0F) {
 f

Mesa (mesa_7_7_branch): softpipe: fix broken cubemap / mipmap selection code

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: mesa_7_7_branch
Commit: 1ff9cd5079b095d7050edb8dc6a7e5b8cad36e1e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ff9cd5079b095d7050edb8dc6a7e5b8cad36e1e

Author: Brian Paul 
Date:   Sat Feb 13 17:34:55 2010 -0700

softpipe: fix broken cubemap / mipmap selection code

This is a quick-fix for the time being...

The per-face mipmap LOD computation was invalid at cube edges.  In
mip_filter_nearest/linear() we were trying to compute LOD using
texcoords that were sometimes indexes into different cube faces.
The subtraction used to compute the partial derivatives basically
gave random values, so the LOD was unpredictable.  This fix simply
uses the same cube face for all four pixels in the quad.  The per-
face texcoords all reference the same cube face so the partial
deriviates are computed properly.

A more elaborate fix would involve computing the LOD at the same
time as we choose the cube faces.  But for now, this solution works
well and allows the piglit/cubemap test to pass.

---

 src/gallium/drivers/softpipe/sp_tex_sample.c |   99 ++---
 1 files changed, 71 insertions(+), 28 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c 
b/src/gallium/drivers/softpipe/sp_tex_sample.c
index c22ee86..2e76798 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1306,6 +1306,11 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler,
 }
 
 
+/**
+ * Compute nearest mipmap level from texcoords.
+ * Then sample the texture level for four elements of a quad.
+ * \param c0  the LOD bias factors, or absolute LODs (depending on control)
+ */
 static void
 mip_filter_nearest(struct tgsi_sampler *tgsi_sampler,
const float s[QUAD_SIZE],
@@ -1500,8 +1505,8 @@ sample_compare(struct tgsi_sampler *tgsi_sampler,
 
 
 /**
- * Compute which cube face is referenced by each texcoord and put that
- * info into the sampler faces[] array.  Then sample the cube faces
+ * Use 3D texcoords to choose a cube face, then sample the 2D cube faces.
+ * Put face info into the sampler faces[] array.
  */
 static void
 sample_cube(struct tgsi_sampler *tgsi_sampler,
@@ -1514,11 +1519,12 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
unsigned j;
float [4], [4];
+   unsigned face;
 
/*
  major axis
- direction target sc tcma
- -----------   ---
+ directiontarget sc tcma
+ --   ---------   ---
  +rx  TEXTURE_CUBE_MAP_POSITIVE_X_EXT-rz-ry   rx
  -rx  TEXTURE_CUBE_MAP_NEGATIVE_X_EXT+rz-ry   rx
  +ry  TEXTURE_CUBE_MAP_POSITIVE_Y_EXT+rx+rz   ry
@@ -1526,56 +1532,93 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
  +rz  TEXTURE_CUBE_MAP_POSITIVE_Z_EXT+rx-ry   rz
  -rz  TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT-rx-ry   rz
*/
-   for (j = 0; j < QUAD_SIZE; j++) {
-  float rx = s[j];
-  float ry = t[j];
-  float rz = p[j];
+
+   /* First choose the cube face.
+* Use the same cube face for all four pixels in the quad.
+*
+* This isn't ideal, but if we want to use a different cube face
+* per pixel in the quad, we'd have to also compute the per-face
+* LOD here too.  That's because the four post-face-selection
+* texcoords are no longer related to each other (they're
+* per-face!)  so we can't use subtraction to compute the partial
+* deriviates to compute the LOD.  Doing so (near cube edges
+* anyway) gives us pretty much random values.
+*/
+   {
+  /* use the average of the four pixel's texcoords to choose the face */
+  const float rx = 0.25 * (s[0] + s[1] + s[2] + s[3]);
+  const float ry = 0.25 * (t[0] + t[1] + t[2] + t[3]);
+  const float rz = 0.25 * (p[0] + p[1] + p[2] + p[3]);
   const float arx = fabsf(rx), ary = fabsf(ry), arz = fabsf(rz);
-  unsigned face;
-  float sc, tc, ma;
 
   if (arx >= ary && arx >= arz) {
  if (rx >= 0.0F) {
 face = PIPE_TEX_FACE_POS_X;
-sc = -rz;
-tc = -ry;
-ma = arx;
  }
  else {
 face = PIPE_TEX_FACE_NEG_X;
-sc = rz;
-tc = -ry;
-ma = arx;
  }
   }
   else if (ary >= arx && ary >= arz) {
  if (ry >= 0.0F) {
 face = PIPE_TEX_FACE_POS_Y;
-sc = rx;
-tc = rz;
-ma = ary;
  }
  else {
 face = PIPE_TEX_FACE_NEG_Y;
-sc = rx;
-tc = -rz;
-ma = ary;
  }
   }
   else {
  if (rz > 0.0F) {
 face = PIPE_TEX_FACE_POS_Z;
-sc = rx;
-   

Mesa (master): mesa: Fix compiler warnings

2010-02-13 Thread Karl Schultz
Module: Mesa
Branch: master
Commit: b30898f4ab533085d97a33638ad0a1cf9ddb1d67
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b30898f4ab533085d97a33638ad0a1cf9ddb1d67

Author: Karl Schultz 
Date:   Sat Feb 13 17:31:58 2010 -0700

mesa: Fix compiler warnings

Add explicit casts, fix constant types, fix variable types.
Fixes about 340 warnings in MSFT Visual Studio.

---

 src/mesa/main/clear.c |   18 +-
 src/mesa/main/image.c |8 
 src/mesa/main/macros.h|4 ++--
 src/mesa/main/texgetimage.c   |4 ++--
 src/mesa/shader/nvprogram.c   |6 +++---
 src/mesa/shader/prog_execute.c|   12 ++--
 src/mesa/shader/prog_parameter.c  |2 +-
 src/mesa/shader/slang/slang_codegen.c |2 +-
 src/mesa/shader/slang/slang_compile.c |2 +-
 src/mesa/swrast/s_aatritemp.h |4 ++--
 src/mesa/swrast/s_atifragshader.c |4 ++--
 src/mesa/swrast/s_clear.c |2 +-
 src/mesa/swrast/s_texcombine.c|2 +-
 src/mesa/swrast_setup/ss_context.c|2 +-
 src/mesa/swrast_setup/ss_tritmp.h |   12 ++--
 src/mesa/tnl/t_draw.c |2 +-
 16 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index 4a3c111..8085bed 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -236,7 +236,7 @@ make_color_buffer_mask(GLcontext *ctx, GLint drawbuffer)
  mask |= BUFFER_BIT_BACK_RIGHT;
   break;
default:
-  if (drawbuffer < 0 || drawbuffer >= ctx->Const.MaxDrawBuffers) {
+  if (drawbuffer < 0 || drawbuffer >= (GLint)ctx->Const.MaxDrawBuffers) {
  mask = INVALID_MASK;
   }
   else if (att[BUFFER_COLOR0 + drawbuffer].Renderbuffer) {
@@ -306,11 +306,11 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, 
const GLint *value)
  * floating point state var.  This will not always work.  We'll
  * need a new ctx->Driver.ClearBuffer() hook
  */
-GLfloat clearSave[4];
+GLclampf clearSave[4];
 /* save color */
 COPY_4V(clearSave, ctx->Color.ClearColor);
 /* set color */
-COPY_4V(ctx->Color.ClearColor, value);
+COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
 if (ctx->Driver.ClearColor)
ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
 /* clear buffer(s) */
@@ -365,11 +365,11 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, 
const GLuint *value)
  * floating point state var.  This will not always work.  We'll
  * need a new ctx->Driver.ClearBuffer() hook
  */
-GLfloat clearSave[4];
+GLclampf clearSave[4];
 /* save color */
 COPY_4V(clearSave, ctx->Color.ClearColor);
 /* set color */
-COPY_4V(ctx->Color.ClearColor, value);
+COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
 if (ctx->Driver.ClearColor)
ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
 /* clear buffer(s) */
@@ -423,7 +423,7 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const 
GLfloat *value)
   * XXX in the future we may have a new ctx->Driver.ClearBuffer()
   * hook instead.
   */
- const GLfloat clearSave = ctx->Depth.Clear;
+ const GLclampd clearSave = ctx->Depth.Clear;
  ctx->Depth.Clear = *value;
  if (ctx->Driver.ClearDepth)
 ctx->Driver.ClearDepth(ctx, *value);
@@ -443,11 +443,11 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, 
const GLfloat *value)
 return;
  }
  else if (mask) {
-GLfloat clearSave[4];
+GLclampf clearSave[4];
 /* save color */
 COPY_4V(clearSave, ctx->Color.ClearColor);
 /* set color */
-COPY_4V(ctx->Color.ClearColor, value);
+COPY_4V_CAST(ctx->Color.ClearColor, value, GLclampf);
 if (ctx->Driver.ClearColor)
ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
 /* clear buffer(s) */
@@ -503,7 +503,7 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
 
{
   /* save current clear values */
-  const GLfloat clearDepthSave = ctx->Depth.Clear;
+  const GLclampd clearDepthSave = ctx->Depth.Clear;
   const GLuint clearStencilSave = ctx->Stencil.Clear;
 
   /* set new clear values */
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 81993e7..468f2a9 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -5662,7 +5662,7 @@ clip_right_or_top(GLint *srcX0, GLint *srcX1,
   /* chop off [t, 1] part */
   ASSERT(t >= 0.0 && t <= 1.0);
   *dstX1 = maxValue;
-  bias = (*srcX0 < *srcX1) ? 0.5 : -0.5;
+  bias = (*srcX0 < *srcX1) ? 0.5F 

Mesa (master): docs: document GL_ARB_fragment_coord_conventions

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 5fd2b46a20321d8600d6256bff17ec3ebc9cb510
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fd2b46a20321d8600d6256bff17ec3ebc9cb510

Author: Brian Paul 
Date:   Sat Feb 13 14:06:25 2010 -0700

docs: document GL_ARB_fragment_coord_conventions

---

 docs/relnotes-7.8.html |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/docs/relnotes-7.8.html b/docs/relnotes-7.8.html
index 7510139..177d11e 100644
--- a/docs/relnotes-7.8.html
+++ b/docs/relnotes-7.8.html
@@ -36,6 +36,7 @@ tbd
 
 GL_NV_conditional_render extension (swrast driver only)
 GL_EXT_draw_buffers2 extension (swrast and i965 driver only)
+GL_ARB_fragment_coord_conventions extension (for swrast and Gallium 
drivers)
 Much improved support for EGL in Mesa
 New state trackers for OpenGL ES 1.1 and 2.0
 Dedicated documentation for Gallium

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


Mesa (master): mesa: enable GL_ARB_fragment_coord_conventions for sw drivers

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 31ed663a433e405fe02f62c004914d559f4456e0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=31ed663a433e405fe02f62c004914d559f4456e0

Author: Brian Paul 
Date:   Sat Feb 13 14:02:54 2010 -0700

mesa: enable GL_ARB_fragment_coord_conventions for sw drivers

This extension is now implemented in the GLSL compiler so it can be
enabled by other drivers where applicable.

---

 src/mesa/main/extensions.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 6ac9595..87c1fac 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -50,8 +50,7 @@ static const struct {
{ OFF, "GL_ARB_depth_clamp",F(ARB_depth_clamp) },
{ ON,  "GL_ARB_draw_buffers",   F(ARB_draw_buffers) },
{ OFF, "GL_ARB_draw_elements_base_vertex",  
F(ARB_draw_elements_base_vertex) },
-   /* TODO: uncomment the following line once GLSL layout(...) support is 
implemented */
-   /* { OFF, "GL_ARB_fragment_coord_conventions", 
F(ARB_fragment_coord_conventions) }, */
+   { OFF, "GL_ARB_fragment_coord_conventions", 
F(ARB_fragment_coord_conventions) },
{ OFF, "GL_ARB_fragment_program",   F(ARB_fragment_program) },
{ OFF, "GL_ARB_fragment_program_shadow",F(ARB_fragment_program_shadow) 
},
{ OFF, "GL_ARB_fragment_shader",F(ARB_fragment_shader) },
@@ -212,6 +211,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
ctx->Extensions.ARB_depth_texture = GL_TRUE;
/*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
+   ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
 #if FEATURE_ARB_fragment_program
ctx->Extensions.ARB_fragment_program = GL_TRUE;
ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;

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


Mesa (master): glsl: implement layout qualifiers

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: c2c4935cb8fe8601c72f585f70d776e3a65f15dc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2c4935cb8fe8601c72f585f70d776e3a65f15dc

Author: Brian Paul 
Date:   Sat Feb 13 13:57:31 2010 -0700

glsl: implement layout qualifiers

For GL_ARB_fragment_coord_conventions.

This only applies to gl_FragCoord and controls pixel center origin and
pixel center integer.  For example:

layout (origin_upper_left, pixel_center_integer) varying vec4 gl_FragCoord;

This features introduces the idea of re-declaring variables with a changed
type.  This may also apply to arrays in some cases but that's not
implemented at this time.

---

 src/mesa/shader/slang/slang_compile.c |  129 -
 1 files changed, 110 insertions(+), 19 deletions(-)

diff --git a/src/mesa/shader/slang/slang_compile.c 
b/src/mesa/shader/slang/slang_compile.c
index 8522741..1dce3ad 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -636,6 +636,38 @@ parse_type_centroid(slang_parse_ctx * C, 
slang_type_centroid *centroid)
 }
 
 
+/* Layout qualifiers */
+#define LAYOUT_QUALIFIER_NONE  0
+#define LAYOUT_QUALIFIER_UPPER_LEFT1
+#define LAYOUT_QUALIFIER_PIXEL_CENTER_INTEGER  2
+
+static int
+parse_layout_qualifiers(slang_parse_ctx * C, slang_layout_qualifier *layout)
+{
+   *layout = 0x0;
+
+   /* the layout qualifiers come as a list of LAYOUT_QUALIFER_x tokens,
+* terminated by LAYOUT_QUALIFIER_NONE.
+*/
+   while (1) {
+  GLuint c = *C->I++;
+  switch (c) {
+  case LAYOUT_QUALIFIER_NONE:
+ /* end of list of qualifiers */
+ return 1;
+  case LAYOUT_QUALIFIER_UPPER_LEFT:
+ *layout |= SLANG_LAYOUT_UPPER_LEFT_BIT;
+ break;
+  case LAYOUT_QUALIFIER_PIXEL_CENTER_INTEGER:
+ *layout |= SLANG_LAYOUT_PIXEL_CENTER_INTEGER_BIT;
+ break;
+  default:
+ assert(0 && "Bad layout qualifier");
+  }
+   }
+}
+
+
 /* type qualifier */
 #define TYPE_QUALIFIER_NONE 0
 #define TYPE_QUALIFIER_CONST 1
@@ -907,9 +939,12 @@ static int
 parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
slang_fully_specified_type * type)
 {
+   if (!parse_layout_qualifiers(C, &type->layout))
+  RETURN0;
+
if (!parse_type_variant(C, &type->variant))
   RETURN0;
-  
+
if (!parse_type_centroid(C, &type->centroid))
   RETURN0;
 
@@ -2029,6 +2064,30 @@ initialize_global(slang_assemble_ctx * A, slang_variable 
* var)
 
 
 /**
+ * Check if it's OK to re-declare a variable with the given new type.
+ * This happens when applying layout qualifiers to gl_FragCoord or
+ * (re)setting an array size.
+ * If redeclaration is OK, return a pointer to the incoming variable
+ * updated with new type info.  Else return NULL;
+ */
+static slang_variable *
+redeclare_variable(slang_variable *var, 
+   const slang_fully_specified_type *type)
+{
+   if (slang_fully_specified_types_compatible(&var->type, type)) {
+  /* replace orig var layout with new layout */
+  var->type.layout = type->layout;
+
+  /* XXX there may be other type updates in the future here */
+
+  return var;
+   }
+   else
+  return NULL;
+}
+
+
+/**
  * Parse the initializer for a variable declaration.
  */
 static int
@@ -2036,7 +2095,7 @@ parse_init_declarator(slang_parse_ctx * C, 
slang_output_ctx * O,
   const slang_fully_specified_type * type)
 {
GET_CURRENT_CONTEXT(ctx); /* a hack */
-   slang_variable *var;
+   slang_variable *var = NULL, *prevDecl;
slang_atom a_name;
 
/* empty init declatator (without name, e.g. "float ;") */
@@ -2046,29 +2105,41 @@ parse_init_declarator(slang_parse_ctx * C, 
slang_output_ctx * O,
a_name = parse_identifier(C);
 
/* check if name is already in this scope */
-   if (_slang_variable_locate(O->vars, a_name, GL_FALSE)) {
-  slang_info_log_error(C->L,
+   prevDecl = _slang_variable_locate(O->vars, a_name, C->global_scope);
+   if (prevDecl) {
+  /* A var with this name has already been declared.
+   * Check if redeclaring the var with a different type/layout is legal.
+   */
+  if (C->global_scope) {
+ var = redeclare_variable(prevDecl, type);
+  }
+  if (!var) {
+ slang_info_log_error(C->L,
"declaration of '%s' conflicts with previous declaration",
(char *) a_name);
-  RETURN0;
+ RETURN0;
+  }
}
 
-   /* make room for the new variable and initialize it */
-   var = slang_variable_scope_grow(O->vars);
if (!var) {
-  slang_info_log_memory(C->L);
-  RETURN0;
-   }
+  /* make room for a new variable and initialize it */
+  var = slang_variable_scope_grow(O->vars);
+  if (!var) {
+ slang_info_log_memory(C->L);
+ RETURN0;
+  }
 
-   /* copy the declarator type qualifier/etc info, parse the id

Mesa (master): mesa: copy frag coord layout fields too

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: b947b1d433ec5a847a3071c0daac7918924f3f49
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b947b1d433ec5a847a3071c0daac7918924f3f49

Author: Brian Paul 
Date:   Sat Feb 13 13:51:38 2010 -0700

mesa: copy frag coord layout fields too

---

 src/mesa/shader/program.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index aaf5f96..18ef6d5 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -505,6 +505,8 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program 
*prog)
  struct gl_fragment_program *fpc = (struct gl_fragment_program *) 
clone;
  fpc->FogOption = fp->FogOption;
  fpc->UsesKill = fp->UsesKill;
+ fpc->OriginUpperLeft = fp->OriginUpperLeft;
+ fpc->PixelCenterInteger = fp->PixelCenterInteger;
   }
   break;
default:

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


Mesa (master): glsl: added type layout field and new type compare func

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 26661ac0e10aba63de093e871e40d336696f4827
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=26661ac0e10aba63de093e871e40d336696f4827

Author: Brian Paul 
Date:   Sat Feb 13 13:52:37 2010 -0700

glsl: added type layout field and new type compare func

Note: because of a weird dependency checking bug, a 'make clean' may be
needed before recompiling.

---

 src/mesa/shader/slang/slang_typeinfo.c |   27 +++
 src/mesa/shader/slang/slang_typeinfo.h |   20 ++--
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/src/mesa/shader/slang/slang_typeinfo.c 
b/src/mesa/shader/slang/slang_typeinfo.c
index 4a48bc8..a96f2fb 100644
--- a/src/mesa/shader/slang/slang_typeinfo.c
+++ b/src/mesa/shader/slang/slang_typeinfo.c
@@ -258,6 +258,7 @@ slang_fully_specified_type_copy(slang_fully_specified_type 
* x,
z.precision = y->precision;
z.variant = y->variant;
z.centroid = y->centroid;
+   z.layout = y->layout;
z.array_len = y->array_len;
if (!slang_type_specifier_copy(&z.specifier, &y->specifier)) {
   slang_fully_specified_type_destruct(&z);
@@ -269,6 +270,32 @@ slang_fully_specified_type_copy(slang_fully_specified_type 
* x,
 }
 
 
+/**
+ * Test if two fully specified types are compatible.  This is a bit
+ * looser than testing for equality.  We don't check the precision,
+ * variant, centroid, etc. information.
+ * XXX this may need some tweaking.
+ */
+GLboolean
+slang_fully_specified_types_compatible(const slang_fully_specified_type * x,
+   const slang_fully_specified_type * y)
+{
+   if (!slang_type_specifier_equal(&x->specifier, &y->specifier))
+  return GL_FALSE;
+
+   if (x->qualifier == SLANG_QUAL_FIXEDINPUT &&
+   y->qualifier == SLANG_QUAL_VARYING)
+  ; /* ok */
+   else if (x->qualifier != y->qualifier)
+  return GL_FALSE;
+
+   /* Note: don't compare precision, variant, centroid */
+
+   /* XXX array length? */
+
+   return GL_TRUE;
+}
+
 
 GLvoid
 slang_type_specifier_ctr(slang_type_specifier * self)
diff --git a/src/mesa/shader/slang/slang_typeinfo.h 
b/src/mesa/shader/slang/slang_typeinfo.h
index e6fecd3..aa5f14e 100644
--- a/src/mesa/shader/slang/slang_typeinfo.h
+++ b/src/mesa/shader/slang/slang_typeinfo.h
@@ -68,6 +68,18 @@ typedef enum slang_type_centroid_
 } slang_type_centroid;
 
 
+/**
+ * These only apply to gl_FragCoord, but other layout qualifiers may
+ * appear in the future.
+ */
+typedef enum slang_layout_qualifier_
+{
+   SLANG_LAYOUT_NONE  = 0x0,
+   SLANG_LAYOUT_UPPER_LEFT_BIT= 0x1,
+   SLANG_LAYOUT_PIXEL_CENTER_INTEGER_BIT  = 0x2
+} slang_layout_qualifier;
+
+
 typedef enum slang_type_qualifier_
 {
SLANG_QUAL_NONE,
@@ -170,8 +182,8 @@ slang_type_specifier_equal(const slang_type_specifier *,
 
 
 extern GLboolean
-slang_type_specifier_compatible(const slang_type_specifier * x,
-const slang_type_specifier * y);
+slang_type_specifier_compatible(const slang_type_specifier *x,
+const slang_type_specifier *y);
 
 
 typedef struct slang_fully_specified_type_
@@ -181,6 +193,7 @@ typedef struct slang_fully_specified_type_
slang_type_precision precision;
slang_type_variant variant;
slang_type_centroid centroid;
+   slang_layout_qualifier layout;
GLint array_len;   /**< -1 if not an array type */
 } slang_fully_specified_type;
 
@@ -194,6 +207,9 @@ extern int
 slang_fully_specified_type_copy(slang_fully_specified_type *,
const slang_fully_specified_type *);
 
+GLboolean
+slang_fully_specified_types_compatible(const slang_fully_specified_type * x,
+   const slang_fully_specified_type * y);
 
 
 typedef struct slang_typeinfo_

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


Mesa (master): glsl/cl: implement parsing for layout qualifiers

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 46f788c2e51630915e5a8cef074daeff8f7fc8cc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=46f788c2e51630915e5a8cef074daeff8f7fc8cc

Author: Brian Paul 
Date:   Sat Feb 13 13:50:26 2010 -0700

glsl/cl: implement parsing for layout qualifiers

For GL_ARB_fragment_coord_conventions support.

---

 src/glsl/cl/sl_cl_parse.c |   78 ++--
 1 files changed, 74 insertions(+), 4 deletions(-)

diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c
index e256ab8..883bc1f 100644
--- a/src/glsl/cl/sl_cl_parse.c
+++ b/src/glsl/cl/sl_cl_parse.c
@@ -120,6 +120,11 @@
 #define TYPE_CENTER95
 #define TYPE_CENTROID  96
 
+/* layout qualifiers */
+#define LAYOUT_QUALIFIER_NONE  0
+#define LAYOUT_QUALIFIER_UPPER_LEFT1
+#define LAYOUT_QUALIFIER_PIXEL_CENTER_INTEGER  2
+
 /* type specifier */
 #define TYPE_SPECIFIER_VOID0
 #define TYPE_SPECIFIER_BOOL1
@@ -297,6 +302,10 @@ struct parse_dict {
int out;
int inout;
 
+   int layout;
+   int origin_upper_left;
+   int pixel_center_integer;
+
int _struct;
 
int __constructor;
@@ -462,6 +471,10 @@ _fetch_token(struct parse_context *ctx,
 }
 
 
+/**
+ * Try to parse/match a particular token.
+ * \return 0 for success, -1 for error.
+ */
 static int
 _parse_token(struct parse_context *ctx,
  enum sl_pp_token token,
@@ -477,6 +490,10 @@ _parse_token(struct parse_context *ctx,
 }
 
 
+/**
+ * Try to parse an identifer.
+ * \return 0 for success, -1 for error
+ */
 static int
 _parse_id(struct parse_context *ctx,
   int id,
@@ -707,8 +724,52 @@ _parse_centroid_qualifier(struct parse_context *ctx,
 
 
 static int
-_parse_type_qualifier(struct parse_context *ctx,
-  struct parse_state *ps)
+_parse_layout_qualifier(struct parse_context *ctx,
+struct parse_state *ps)
+{
+   if (_parse_id(ctx, ctx->dict.layout, ps) == 0) {
+  /* start of a parenthesised list of layout qualifiers */
+
+  if (_parse_token(ctx, SL_PP_LPAREN, ps)) {
+ _error(ctx, "expected `('");
+ return -1;
+  }
+
+  /* parse comma-separated ID list */
+  while (1) {
+ if (_parse_id(ctx, ctx->dict.origin_upper_left, ps) == 0) {
+_emit(ctx, &ps->out, LAYOUT_QUALIFIER_UPPER_LEFT);
+ }
+ else if (_parse_id(ctx, ctx->dict.pixel_center_integer, ps) == 0) {
+_emit(ctx, &ps->out, LAYOUT_QUALIFIER_PIXEL_CENTER_INTEGER);
+ }
+ else {
+_error(ctx, "expected a layout qualifier");
+return -1;
+ }
+
+ if (_parse_token(ctx, SL_PP_RPAREN, ps) == 0) {
+/* all done */
+break;
+ }
+ else if (_parse_token(ctx, SL_PP_COMMA, ps) == 0) {
+/* another layout qualifier is coming */
+ }
+ else {
+_error(ctx, "expected `,' or `)'");
+return -1;
+ }
+  }
+
+   }
+
+   return -1;
+}
+
+
+static int
+_parse_storage_qualifier(struct parse_context *ctx,
+ struct parse_state *ps)
 {
struct parse_state p = *ps;
const struct sl_pp_token_info *input = _fetch_token(ctx, p.in);
@@ -1006,13 +1067,18 @@ _parse_fully_specified_type(struct parse_context *ctx,
 {
struct parse_state p = *ps;
 
+   if (_parse_layout_qualifier(ctx, &p)) {
+  _emit(ctx, &p.out, LAYOUT_QUALIFIER_NONE);
+   }
+
if (_parse_invariant_qualifier(ctx, &p)) {
   _emit(ctx, &p.out, TYPE_VARIANT);
}
+
if (_parse_centroid_qualifier(ctx, &p)) {
   _emit(ctx, &p.out, TYPE_CENTER);
}
-   if (_parse_type_qualifier(ctx, &p)) {
+   if (_parse_storage_qualifier(ctx, &p)) {
   _emit(ctx, &p.out, TYPE_QUALIFIER_NONE);
}
if (_parse_precision(ctx, &p)) {
@@ -1698,7 +1764,7 @@ _parse_parameter_declaration(struct parse_context *ctx,
 
(void) e;
 
-   if (_parse_type_qualifier(ctx, &p)) {
+   if (_parse_storage_qualifier(ctx, &p)) {
   _emit(ctx, &p.out, TYPE_QUALIFIER_NONE);
}
_parse_parameter_qualifier(ctx, &p);
@@ -2772,6 +2838,10 @@ sl_cl_compile(struct sl_pp_context *context,
ADD_NAME(ctx, out);
ADD_NAME(ctx, inout);
 
+   ADD_NAME(ctx, layout);
+   ADD_NAME(ctx, origin_upper_left);
+   ADD_NAME(ctx, pixel_center_integer);
+
ADD_NAME_STR(ctx, _struct, "struct");
 
ADD_NAME(ctx, __constructor);

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


Mesa (master): glsl/pp: fix incorrect extension enable flag for warn mode

2010-02-13 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 3b53b7e8b06d4caa4bebcc0d58ec0a0233ac77ba
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b53b7e8b06d4caa4bebcc0d58ec0a0233ac77ba

Author: Brian Paul 
Date:   Sat Feb 13 13:48:32 2010 -0700

glsl/pp: fix incorrect extension enable flag for warn mode

---

 src/glsl/pp/sl_pp_extension.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c
index 777e42d..2b6cf3c 100644
--- a/src/glsl/pp/sl_pp_extension.c
+++ b/src/glsl/pp/sl_pp_extension.c
@@ -155,7 +155,7 @@ sl_pp_process_extension(struct sl_pp_context *context,
  return 0;
   }
   out.token = SL_PP_EXTENSION_WARN;
-  extension->enabled = 0;
+  extension->enabled = 1;
} else if (behavior == context->dict.disable) {
   if (out.data.extension == -1) {
  /* Warning: the extension is not supported. */

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


Mesa (master): wgl: Implement wglSwapMultipleBuffers.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: a583c3ab476078332679f96d2ca7fe8aab4c8d2d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a583c3ab476078332679f96d2ca7fe8aab4c8d2d

Author: José Fonseca 
Date:   Sat Feb 13 15:09:46 2010 +

wgl: Implement wglSwapMultipleBuffers.

---

 src/gallium/state_trackers/wgl/opengl32.def   |2 +-
 src/gallium/state_trackers/wgl/opengl32.mingw.def |2 +-
 src/gallium/state_trackers/wgl/stw_wgl.c  |   13 +
 src/gallium/state_trackers/wgl/stw_wgl.h  |   16 
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/opengl32.def 
b/src/gallium/state_trackers/wgl/opengl32.def
index 5daa6dd..01a29d0 100644
--- a/src/gallium/state_trackers/wgl/opengl32.def
+++ b/src/gallium/state_trackers/wgl/opengl32.def
@@ -362,7 +362,7 @@ EXPORTS
wglShareLists
wglSwapBuffers
wglSwapLayerBuffers
-;  wglSwapMultipleBuffers
+   wglSwapMultipleBuffers
wglUseFontBitmapsA
wglUseFontBitmapsW
wglUseFontOutlinesA
diff --git a/src/gallium/state_trackers/wgl/opengl32.mingw.def 
b/src/gallium/state_trackers/wgl/opengl32.mingw.def
index 6ebb31a..0bceee0 100644
--- a/src/gallium/state_trackers/wgl/opengl32.mingw.def
+++ b/src/gallium/state_trackers/wgl/opengl32.mingw.def
@@ -362,7 +362,7 @@ EXPORTS
wglShareLists = wglshareli...@8
wglSwapBuffers = wglswapbuff...@4
wglSwapLayerBuffers = wglswaplayerbuff...@8
-;  wglSwapMultipleBuffers = wglswapmultiplebuff...@8
+   wglSwapMultipleBuffers = wglswapmultiplebuff...@8
wglUseFontBitmapsA = wglusefontbitma...@16
wglUseFontBitmapsW = wglusefontbitma...@16
wglUseFontOutlinesA = wglusefontoutlin...@32
diff --git a/src/gallium/state_trackers/wgl/stw_wgl.c 
b/src/gallium/state_trackers/wgl/stw_wgl.c
index bb199fd..5fbb7bf 100644
--- a/src/gallium/state_trackers/wgl/stw_wgl.c
+++ b/src/gallium/state_trackers/wgl/stw_wgl.c
@@ -97,6 +97,19 @@ wglSwapBuffers(
 }
 
 
+WINGDIAPI DWORD WINAPI
+wglSwapMultipleBuffers(UINT n,
+   CONST WGLSWAP *ps)
+{
+   UINT i;
+
+   for (i =0; i < n; ++i)
+  wglSwapBuffers(ps->hdc);
+
+   return 0;
+}
+
+
 WINGDIAPI BOOL APIENTRY
 wglSwapLayerBuffers(
HDC hdc,
diff --git a/src/gallium/state_trackers/wgl/stw_wgl.h 
b/src/gallium/state_trackers/wgl/stw_wgl.h
index a981799..57baaf0 100644
--- a/src/gallium/state_trackers/wgl/stw_wgl.h
+++ b/src/gallium/state_trackers/wgl/stw_wgl.h
@@ -59,5 +59,21 @@ wglSetPixelFormat(HDC hdc,
   int iPixelFormat,
   CONST PIXELFORMATDESCRIPTOR *ppfd);
 
+#if defined(__MINGW32__) || (WINVER < 0x0500)
+
+typedef struct _WGLSWAP
+{
+   HDC hdc;
+   UINT uiFlags;
+} WGLSWAP;
+
+#define WGL_SWAPMULTIPLE_MAX 16
+
+WINGDIAPI DWORD WINAPI
+wglSwapMultipleBuffers(UINT n,
+   CONST WGLSWAP *ps);
+
+#endif
+
 
 #endif /* STW_WGL_H_ */

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


Mesa (master): svga: Fix texture border color.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 6b1193820f8985e2a7182fcc983fbaf17802e139
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b1193820f8985e2a7182fcc983fbaf17802e139

Author: José Fonseca 
Date:   Sat Feb 13 09:16:57 2010 +

svga: Fix texture border color.

Also opposite ordering.

---

 src/gallium/drivers/svga/svga_pipe_sampler.c |   16 ++--
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c 
b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 2a9adfb..224c4f4 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -27,7 +27,6 @@
 #include "pipe/p_defines.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
-#include "util/u_pack_color.h"
 #include "tgsi/tgsi_parse.h"
 
 #include "svga_context.h"
@@ -97,7 +96,6 @@ svga_create_sampler_state(struct pipe_context *pipe,
 {
struct svga_context *svga = svga_context(pipe);
struct svga_sampler_state *cso = CALLOC_STRUCT( svga_sampler_state );
-   union util_color uc;

cso->mipfilter = translate_mip_filter(sampler->min_mip_filter);
cso->magfilter = translate_img_filter( sampler->mag_img_filter );
@@ -114,14 +112,12 @@ svga_create_sampler_state(struct pipe_context *pipe,
cso->compare_func = sampler->compare_func;
 
{
-  ubyte r = float_to_ubyte(sampler->border_color[0]);
-  ubyte g = float_to_ubyte(sampler->border_color[1]);
-  ubyte b = float_to_ubyte(sampler->border_color[2]);
-  ubyte a = float_to_ubyte(sampler->border_color[3]);
-
-  util_pack_color_ub( r, g, b, a,
-  PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
-  cso->bordercolor = uc.ui;
+  uint32 r = float_to_ubyte(sampler->border_color[0]);
+  uint32 g = float_to_ubyte(sampler->border_color[1]);
+  uint32 b = float_to_ubyte(sampler->border_color[2]);
+  uint32 a = float_to_ubyte(sampler->border_color[3]);
+
+  cso->bordercolor = (a << 24) | (r << 16) | (g << 8) | b;
}
 
/* No SVGA3D support for:

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


Mesa (master): mesa: Export GL_EXT_texture_cube_map.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 744994a9c6b972a737e432cf1b699f232e2c5bfd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=744994a9c6b972a737e432cf1b699f232e2c5bfd

Author: José Fonseca 
Date:   Sat Feb 13 15:10:24 2010 +

mesa: Export GL_EXT_texture_cube_map.

Still used by some applications.

---

 src/mesa/main/extensions.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index e132022..6ac9595 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -133,6 +133,7 @@ static const struct {
{ ON,  "GL_EXT_texture",F(EXT_texture) },
{ ON,  "GL_EXT_texture3D",  F(EXT_texture3D) },
{ OFF, "GL_EXT_texture_compression_s3tc",   F(EXT_texture_compression_s3tc) 
},
+   { OFF, "GL_EXT_texture_cube_map",   F(ARB_texture_cube_map) },
{ ON,  "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) },
{ OFF, "GL_EXT_texture_env_add",F(EXT_texture_env_add) },
{ OFF, "GL_EXT_texture_env_combine",F(EXT_texture_env_combine) },

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


Mesa (mesa_7_7_branch): wgl: Implement wglSwapMultipleBuffers.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 6bd6a15ab3b4a5975f21194b7da621ff6b3c45e6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6bd6a15ab3b4a5975f21194b7da621ff6b3c45e6

Author: José Fonseca 
Date:   Sat Feb 13 15:09:46 2010 +

wgl: Implement wglSwapMultipleBuffers.

---

 src/gallium/state_trackers/wgl/opengl32.def   |2 +-
 src/gallium/state_trackers/wgl/opengl32.mingw.def |2 +-
 src/gallium/state_trackers/wgl/stw_wgl.c  |   13 +
 src/gallium/state_trackers/wgl/stw_wgl.h  |   16 
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/opengl32.def 
b/src/gallium/state_trackers/wgl/opengl32.def
index 5daa6dd..01a29d0 100644
--- a/src/gallium/state_trackers/wgl/opengl32.def
+++ b/src/gallium/state_trackers/wgl/opengl32.def
@@ -362,7 +362,7 @@ EXPORTS
wglShareLists
wglSwapBuffers
wglSwapLayerBuffers
-;  wglSwapMultipleBuffers
+   wglSwapMultipleBuffers
wglUseFontBitmapsA
wglUseFontBitmapsW
wglUseFontOutlinesA
diff --git a/src/gallium/state_trackers/wgl/opengl32.mingw.def 
b/src/gallium/state_trackers/wgl/opengl32.mingw.def
index 6ebb31a..0bceee0 100644
--- a/src/gallium/state_trackers/wgl/opengl32.mingw.def
+++ b/src/gallium/state_trackers/wgl/opengl32.mingw.def
@@ -362,7 +362,7 @@ EXPORTS
wglShareLists = wglshareli...@8
wglSwapBuffers = wglswapbuff...@4
wglSwapLayerBuffers = wglswaplayerbuff...@8
-;  wglSwapMultipleBuffers = wglswapmultiplebuff...@8
+   wglSwapMultipleBuffers = wglswapmultiplebuff...@8
wglUseFontBitmapsA = wglusefontbitma...@16
wglUseFontBitmapsW = wglusefontbitma...@16
wglUseFontOutlinesA = wglusefontoutlin...@32
diff --git a/src/gallium/state_trackers/wgl/stw_wgl.c 
b/src/gallium/state_trackers/wgl/stw_wgl.c
index bb199fd..5fbb7bf 100644
--- a/src/gallium/state_trackers/wgl/stw_wgl.c
+++ b/src/gallium/state_trackers/wgl/stw_wgl.c
@@ -97,6 +97,19 @@ wglSwapBuffers(
 }
 
 
+WINGDIAPI DWORD WINAPI
+wglSwapMultipleBuffers(UINT n,
+   CONST WGLSWAP *ps)
+{
+   UINT i;
+
+   for (i =0; i < n; ++i)
+  wglSwapBuffers(ps->hdc);
+
+   return 0;
+}
+
+
 WINGDIAPI BOOL APIENTRY
 wglSwapLayerBuffers(
HDC hdc,
diff --git a/src/gallium/state_trackers/wgl/stw_wgl.h 
b/src/gallium/state_trackers/wgl/stw_wgl.h
index a981799..57baaf0 100644
--- a/src/gallium/state_trackers/wgl/stw_wgl.h
+++ b/src/gallium/state_trackers/wgl/stw_wgl.h
@@ -59,5 +59,21 @@ wglSetPixelFormat(HDC hdc,
   int iPixelFormat,
   CONST PIXELFORMATDESCRIPTOR *ppfd);
 
+#if defined(__MINGW32__) || (WINVER < 0x0500)
+
+typedef struct _WGLSWAP
+{
+   HDC hdc;
+   UINT uiFlags;
+} WGLSWAP;
+
+#define WGL_SWAPMULTIPLE_MAX 16
+
+WINGDIAPI DWORD WINAPI
+wglSwapMultipleBuffers(UINT n,
+   CONST WGLSWAP *ps);
+
+#endif
+
 
 #endif /* STW_WGL_H_ */

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


Mesa (mesa_7_7_branch): mesa: Export GL_EXT_texture_cube_map.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 4a2b54cbdb21666f442b83024c61dafbbdd98aa7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a2b54cbdb21666f442b83024c61dafbbdd98aa7

Author: José Fonseca 
Date:   Sat Feb 13 15:10:24 2010 +

mesa: Export GL_EXT_texture_cube_map.

Still used by some applications.

---

 src/mesa/main/extensions.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2138bfe..fd705ea 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -129,6 +129,7 @@ static const struct {
{ ON,  "GL_EXT_texture",F(EXT_texture) },
{ ON,  "GL_EXT_texture3D",  F(EXT_texture3D) },
{ OFF, "GL_EXT_texture_compression_s3tc",   F(EXT_texture_compression_s3tc) 
},
+   { OFF, "GL_EXT_texture_cube_map",   F(ARB_texture_cube_map) },
{ ON,  "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) },
{ OFF, "GL_EXT_texture_env_add",F(EXT_texture_env_add) },
{ OFF, "GL_EXT_texture_env_combine",F(EXT_texture_env_combine) },

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


Mesa (mesa_7_7_branch): svga: Fix texture border color.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: c1a5c9bb4c3c68bea483a0a5bd77b26b150434d2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1a5c9bb4c3c68bea483a0a5bd77b26b150434d2

Author: José Fonseca 
Date:   Sat Feb 13 09:16:57 2010 +

svga: Fix texture border color.

Also opposite ordering.

---

 src/gallium/drivers/svga/svga_pipe_sampler.c |   15 ++-
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c 
b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 9cc69c8..c1e0166 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -27,7 +27,6 @@
 #include "pipe/p_defines.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
-#include "util/u_pack_color.h"
 #include "tgsi/tgsi_parse.h"
 
 #include "svga_context.h"
@@ -112,14 +111,12 @@ svga_create_sampler_state(struct pipe_context *pipe,
cso->compare_func = sampler->compare_func;
 
{
-  ubyte r = float_to_ubyte(sampler->border_color[0]);
-  ubyte g = float_to_ubyte(sampler->border_color[1]);
-  ubyte b = float_to_ubyte(sampler->border_color[2]);
-  ubyte a = float_to_ubyte(sampler->border_color[3]);
-
-  util_pack_color_ub( r, g, b, a,
-  PIPE_FORMAT_B8G8R8A8_UNORM,
-  &cso->bordercolor );
+  uint32 r = float_to_ubyte(sampler->border_color[0]);
+  uint32 g = float_to_ubyte(sampler->border_color[1]);
+  uint32 b = float_to_ubyte(sampler->border_color[2]);
+  uint32 a = float_to_ubyte(sampler->border_color[3]);
+
+  cso->bordercolor = (a << 24) | (r << 16) | (g << 8) | b;
}
 
/* No SVGA3D support for:

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


Mesa (master): r300g: do not invalidate texture caches when only sampler state is changed

2010-02-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 43b4d2a048ee8e89e7b8ab38d0ad2bc2daae8402
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=43b4d2a048ee8e89e7b8ab38d0ad2bc2daae8402

Author: Marek Olšák 
Date:   Fri Feb 12 05:03:27 2010 +0100

r300g: do not invalidate texture caches when only sampler state is changed

---

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

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 3b59367..5a4196c 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -1148,14 +1148,15 @@ void r300_emit_dirty_state(struct r300_context* r300)
 for (i = 0; i < MIN2(r300->sampler_count, r300->texture_count); i++) {
if (r300->dirty_state &
((R300_NEW_SAMPLER << i) | (R300_NEW_TEXTURE << i))) {
-   if (r300->textures[i]) 
+   if (r300->textures[i]) {
r300_emit_texture(r300,
  r300->sampler_states[i],
  r300->textures[i],
  i);
+dirty_tex |= r300->dirty_state & (R300_NEW_TEXTURE << i);
+}
 r300->dirty_state &=
 ~((R300_NEW_SAMPLER << i) | (R300_NEW_TEXTURE << i));
-dirty_tex++;
 }
 }
 r300->dirty_state &= ~(R300_ANY_NEW_SAMPLERS | R300_ANY_NEW_TEXTURES);

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


Mesa (master): r300g: cleanup the emission of RS block state

2010-02-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 8eb4cd5b825db7bf26da240ccddaf9a7e5e55a62
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8eb4cd5b825db7bf26da240ccddaf9a7e5e55a62

Author: Marek Olšák 
Date:   Fri Feb 12 04:49:30 2010 +0100

r300g: cleanup the emission of RS block state

Emit as few regs as possible.

---

 src/gallium/drivers/r300/r300_emit.c  |   16 +---
 src/gallium/drivers/r300/r300_state_derived.c |6 --
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 7399ab8..3b59367 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -629,17 +629,19 @@ void r300_emit_rs_block_state(struct r300_context* r300, 
void* state)
 struct r300_rs_block* rs = (struct r300_rs_block*)state;
 unsigned i;
 struct r300_screen* r300screen = r300_screen(r300->context.screen);
+/* It's the same for both INST and IP tables */
+unsigned count = (rs->inst_count & R300_RS_INST_COUNT_MASK) + 1;
 CS_LOCALS(r300);
 
 DBG(r300, DBG_DRAW, "r300: RS emit:\n");
 
-BEGIN_CS(21);
+BEGIN_CS(5 + count*2);
 if (r300screen->caps->is_r500) {
-OUT_CS_REG_SEQ(R500_RS_IP_0, 8);
+OUT_CS_REG_SEQ(R500_RS_IP_0, count);
 } else {
-OUT_CS_REG_SEQ(R300_RS_IP_0, 8);
+OUT_CS_REG_SEQ(R300_RS_IP_0, count);
 }
-for (i = 0; i < 8; i++) {
+for (i = 0; i < count; i++) {
 OUT_CS(rs->ip[i]);
 DBG(r300, DBG_DRAW, ": ip %d: 0x%08x\n", i, rs->ip[i]);
 }
@@ -649,11 +651,11 @@ void r300_emit_rs_block_state(struct r300_context* r300, 
void* state)
 OUT_CS(rs->inst_count);
 
 if (r300screen->caps->is_r500) {
-OUT_CS_REG_SEQ(R500_RS_INST_0, 8);
+OUT_CS_REG_SEQ(R500_RS_INST_0, count);
 } else {
-OUT_CS_REG_SEQ(R300_RS_INST_0, 8);
+OUT_CS_REG_SEQ(R300_RS_INST_0, count);
 }
-for (i = 0; i < 8; i++) {
+for (i = 0; i < count; i++) {
 OUT_CS(rs->inst[i]);
 DBG(r300, DBG_DRAW, ": inst %d: 0x%08x\n", i, rs->inst[i]);
 }
diff --git a/src/gallium/drivers/r300/r300_state_derived.c 
b/src/gallium/drivers/r300/r300_state_derived.c
index bad9e76..2cbce92 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -306,7 +306,7 @@ static void r300_update_rs_block(struct r300_context* r300,
  struct r300_shader_semantics* fs_inputs)
 {
 struct r300_rs_block rs = { { 0 } };
-int i, col_count = 0, tex_count = 0, fp_offset = 0;
+int i, col_count = 0, tex_count = 0, fp_offset = 0, count;
 void (*rX00_rs_col)(struct r300_rs_block*, int, int, boolean);
 void (*rX00_rs_col_write)(struct r300_rs_block*, int, int);
 void (*rX00_rs_tex)(struct r300_rs_block*, int, int, boolean);
@@ -410,11 +410,13 @@ static void r300_update_rs_block(struct r300_context* 
r300,
 rs.count = (tex_count*4) | (col_count << R300_IC_COUNT_SHIFT) |
 R300_HIRES_EN;
 
-rs.inst_count = MAX3(col_count - 1, tex_count - 1, 0);
+count = MAX3(col_count, tex_count, 1);
+rs.inst_count = count - 1;
 
 /* Now, after all that, see if we actually need to update the state. */
 if (memcmp(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block))) 
{
 memcpy(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block));
+r300->rs_block_state.size = 5 + count;
 r300->rs_block_state.dirty = TRUE;
 }
 }

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


Mesa (master): r300g: cleanup the emission of framebuffer state

2010-02-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 67049b59fdc3fb8dff6a04cb4929f48c28cd88ca
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=67049b59fdc3fb8dff6a04cb4929f48c28cd88ca

Author: Marek Olšák 
Date:   Fri Feb 12 04:19:55 2010 +0100

r300g: cleanup the emission of framebuffer state

Some emits are not needed anymore.

---

 src/gallium/drivers/r300/r300_emit.c  |8 +---
 src/gallium/drivers/r300/r300_state.c |6 ++
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 324952b..7399ab8 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -388,8 +388,7 @@ void r300_emit_fb_state(struct r300_context* r300, void* 
state)
 int i;
 CS_LOCALS(r300);
 
-BEGIN_CS((10 * fb->nr_cbufs) + (2 * (4 - fb->nr_cbufs)) +
- (fb->zsbuf ? 10 : 0) + 6);
+BEGIN_CS((10 * fb->nr_cbufs) + (fb->zsbuf ? 10 : 0) + 6);
 
 /* Flush and free renderbuffer caches. */
 OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT,
@@ -433,11 +432,6 @@ void r300_emit_fb_state(struct r300_context* r300, void* 
state)
 r300_translate_out_fmt(surf->format));
 }
 
-/* Disable unused colorbuffers. */
-for (; i < 4; i++) {
-OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), R300_US_OUT_FMT_UNUSED);
-}
-
 /* Set up a zbuffer. */
 if (fb->zsbuf) {
 surf = fb->zsbuf;
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 4d158cf..7fc51cd 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -505,9 +505,6 @@ static void
 unsigned max_width, max_height;
 uint32_t zbuffer_bpp = 0;
 
-r300->fb_state.size = (10 * state->nr_cbufs) +
-(2 * (4 - state->nr_cbufs)) +
-(state->zsbuf ? 10 : 0) + 6;
 
 if (state->nr_cbufs > 4) {
 debug_printf("r300: Implementation error: Too many MRTs in %s, "
@@ -535,7 +532,8 @@ static void
 
 memcpy(r300->fb_state.state, state, sizeof(struct pipe_framebuffer_state));
 
-/* Don't rely on the order of states being set for the first time. */
+r300->fb_state.size = (10 * state->nr_cbufs) + (state->zsbuf ? 10 : 0) + 6;
+
 /* XXX wait what */
 r300->blend_state.dirty = TRUE;
 r300->dsa_state.dirty = TRUE;

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


Mesa (master): r300g: emit INDEPENDENT_COLORFORMAT_ENABLE only on r5xx

2010-02-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 75910e96dc9704e2ade842fde2647b27393ddcb7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=75910e96dc9704e2ade842fde2647b27393ddcb7

Author: Marek Olšák 
Date:   Fri Feb 12 03:51:41 2010 +0100

r300g: emit INDEPENDENT_COLORFORMAT_ENABLE only on r5xx

---

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

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index d31336e..26bdcff 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -408,8 +408,7 @@ void r300_emit_fb_state(struct r300_context* r300, void* 
state)
 R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE);
 } else {
 OUT_CS_REG(R300_RB3D_CCTL,
-R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
-R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE);
+R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs));
 }
 } else {
 OUT_CS_REG(R300_RB3D_CCTL, 0x0);

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


Mesa (master): r300g: disable independent blend enables

2010-02-13 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 8e2f9f4009ae9974a1fd51466a1e8080bdcdbdc0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e2f9f4009ae9974a1fd51466a1e8080bdcdbdc0

Author: Marek Olšák 
Date:   Fri Feb 12 04:01:15 2010 +0100

r300g: disable independent blend enables

Not supported by r300.

---

 src/gallium/drivers/r300/r300_emit.c   |3 +--
 src/gallium/drivers/r300/r300_screen.c |6 +-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index 26bdcff..324952b 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -404,8 +404,7 @@ void r300_emit_fb_state(struct r300_context* r300, void* 
state)
 if (r300screen->caps->is_r500) {
 OUT_CS_REG(R300_RB3D_CCTL,
 R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
-R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE |
-R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE);
+R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE);
 } else {
 OUT_CS_REG(R300_RB3D_CCTL,
 R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs));
diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index 13cd04a..7c8dd75 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -153,11 +153,7 @@ static int r300_get_param(struct pipe_screen* pscreen, int 
param)
 return 0;
 }
 case PIPE_CAP_INDEP_BLEND_ENABLE:
-if (r300screen->caps->is_r500) {
-return 1;
-} else {
-return 0;
-}
+return 0;
 case PIPE_CAP_INDEP_BLEND_FUNC:
 return 0;
 case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:

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


Mesa (master): mesa: s/abort/sys.exit/

2010-02-13 Thread Vinson Lee
Module: Mesa
Branch: master
Commit: bf1096a778e9537d9e0970660effdf307115faf0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf1096a778e9537d9e0970660effdf307115faf0

Author: Vinson Lee 
Date:   Sat Feb 13 00:05:29 2010 -0800

mesa: s/abort/sys.exit/

Python does not have the function abort.

---

 src/mesa/main/get_gen.py |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index b37a373..64aa2ac 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -27,6 +27,7 @@
 
 
 import string
+import sys
 
 
 GLint = 1
@@ -1134,7 +1135,7 @@ def EmitGetFunction(stateVars, returnType, indexed):
elif returnType == GLint64:
function = "GetInteger64v"
else:
-   abort()
+   sys.exit(1)
 
if returnType == GLint64:
print "#if FEATURE_ARB_sync"

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