Mesa (7.9): st/dri: Track drawable context bindings

2011-02-21 Thread Marek Olšák
Module: Mesa
Branch: 7.9
Commit: cd42dda3a50a72947eb1ba0950ad2558339cd03d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd42dda3a50a72947eb1ba0950ad2558339cd03d

Author: Marek Olšák 
Date:   Sun Feb 20 17:08:20 2011 +0100

st/dri: Track drawable context bindings

Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
(cherry picked from commit 94ccc31ba4f64ac480137fd90f1ded44d2072f6e)

Conflicts:

src/gallium/state_trackers/dri/common/dri_context.c

---

 .../state_trackers/dri/common/dri_context.c|   10 +-
 .../state_trackers/dri/common/dri_drawable.c   |1 +
 .../state_trackers/dri/common/dri_drawable.h   |3 +++
 src/gallium/state_trackers/dri/drm/dri2.c  |2 +-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_context.c 
b/src/gallium/state_trackers/dri/common/dri_context.c
index 22e1b6d..8441ad5 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -141,12 +141,18 @@ GLboolean
 dri_unbind_context(__DRIcontext * cPriv)
 {
/* dri_util.c ensures cPriv is not null */
+   struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
struct dri_context *ctx = dri_context(cPriv);
+   struct dri_drawable *draw = dri_drawable(ctx->dPriv);
+   struct dri_drawable *read = dri_drawable(ctx->rPriv);
+   struct st_api *stapi = screen->st_api;
 
if (--ctx->bind_count == 0) {
   if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
  ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
- ctx->stapi->make_current(ctx->stapi, NULL, NULL, NULL);
+ stapi->make_current(stapi, NULL, NULL, NULL);
+ draw->context = NULL;
+ read->context = NULL;
   }
}
 
@@ -169,10 +175,12 @@ dri_make_current(__DRIcontext * cPriv,
 
++ctx->bind_count;
 
+   draw->context = ctx;
if (ctx->dPriv != driDrawPriv) {
   ctx->dPriv = driDrawPriv;
   draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
+   read->context = ctx;
if (ctx->rPriv != driReadPriv) {
   ctx->rPriv = driReadPriv;
   read->texture_stamp = driReadPriv->lastStamp - 1;
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c 
b/src/gallium/state_trackers/dri/common/dri_drawable.c
index 1bdfdcc..dd7f63e 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.c
@@ -132,6 +132,7 @@ dri_create_buffer(__DRIscreen * sPriv,
drawable->base.validate = dri_st_framebuffer_validate;
drawable->base.st_manager_private = (void *) drawable;
 
+   drawable->screen = screen;
drawable->sPriv = sPriv;
drawable->dPriv = dPriv;
dPriv->driverPrivate = (void *)drawable;
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.h 
b/src/gallium/state_trackers/dri/common/dri_drawable.h
index 74e662d..39fe752 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.h
@@ -41,6 +41,9 @@ struct dri_drawable
struct st_framebuffer_iface base;
struct st_visual stvis;
 
+   struct dri_screen *screen;
+   struct dri_context *context;
+
/* dri */
__DRIdrawable *dPriv;
__DRIscreen *sPriv;
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c 
b/src/gallium/state_trackers/dri/drm/dri2.c
index 116afcc..025ca1b 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -51,7 +51,7 @@ static void
 dri2_invalidate_drawable(__DRIdrawable *dPriv)
 {
struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct dri_context *ctx = dri_context(dPriv->driContextPriv);
+   struct dri_context *ctx = drawable->context;
 
dri2InvalidateDrawable(dPriv);
drawable->dPriv->lastStamp = *drawable->dPriv->pStamp;

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


Mesa (7.10): st/dri: Track drawable context bindings

2011-02-21 Thread Marek Olšák
Module: Mesa
Branch: 7.10
Commit: e7d1b5489e3ec8e1e63120218efe5fcb72e879d6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7d1b5489e3ec8e1e63120218efe5fcb72e879d6

Author: Marek Olšák 
Date:   Sun Feb 20 17:03:43 2011 +0100

st/dri: Track drawable context bindings

Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
(cherry picked from commit 94ccc31ba4f64ac480137fd90f1ded44d2072f6e)

Conflicts:

src/gallium/state_trackers/dri/common/dri_context.c

---

 .../state_trackers/dri/common/dri_context.c|   10 +-
 .../state_trackers/dri/common/dri_drawable.c   |1 +
 .../state_trackers/dri/common/dri_drawable.h   |3 +++
 src/gallium/state_trackers/dri/drm/dri2.c  |2 +-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_context.c 
b/src/gallium/state_trackers/dri/common/dri_context.c
index 3d5d24e..aef1892 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -141,12 +141,18 @@ GLboolean
 dri_unbind_context(__DRIcontext * cPriv)
 {
/* dri_util.c ensures cPriv is not null */
+   struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
struct dri_context *ctx = dri_context(cPriv);
+   struct dri_drawable *draw = dri_drawable(ctx->dPriv);
+   struct dri_drawable *read = dri_drawable(ctx->rPriv);
+   struct st_api *stapi = screen->st_api;
 
if (--ctx->bind_count == 0) {
   if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
  ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
- ctx->stapi->make_current(ctx->stapi, NULL, NULL, NULL);
+ stapi->make_current(stapi, NULL, NULL, NULL);
+ draw->context = NULL;
+ read->context = NULL;
   }
}
 
@@ -169,10 +175,12 @@ dri_make_current(__DRIcontext * cPriv,
 
++ctx->bind_count;
 
+   draw->context = ctx;
if (ctx->dPriv != driDrawPriv) {
   ctx->dPriv = driDrawPriv;
   draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
+   read->context = ctx;
if (ctx->rPriv != driReadPriv) {
   ctx->rPriv = driReadPriv;
   read->texture_stamp = driReadPriv->lastStamp - 1;
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c 
b/src/gallium/state_trackers/dri/common/dri_drawable.c
index 5fd6e78..6193670 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.c
@@ -132,6 +132,7 @@ dri_create_buffer(__DRIscreen * sPriv,
drawable->base.validate = dri_st_framebuffer_validate;
drawable->base.st_manager_private = (void *) drawable;
 
+   drawable->screen = screen;
drawable->sPriv = sPriv;
drawable->dPriv = dPriv;
dPriv->driverPrivate = (void *)drawable;
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.h 
b/src/gallium/state_trackers/dri/common/dri_drawable.h
index 2ff6b71..7f1aa51 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.h
@@ -41,6 +41,9 @@ struct dri_drawable
struct st_framebuffer_iface base;
struct st_visual stvis;
 
+   struct dri_screen *screen;
+   struct dri_context *context;
+
/* dri */
__DRIdrawable *dPriv;
__DRIscreen *sPriv;
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c 
b/src/gallium/state_trackers/dri/drm/dri2.c
index a9d05a8..997a17b 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -51,7 +51,7 @@ static void
 dri2_invalidate_drawable(__DRIdrawable *dPriv)
 {
struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct dri_context *ctx = dri_context(dPriv->driContextPriv);
+   struct dri_context *ctx = drawable->context;
 
dri2InvalidateDrawable(dPriv);
drawable->dPriv->lastStamp = *drawable->dPriv->pStamp;

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


Mesa (master): st/dri: Track drawable context bindings

2011-02-21 Thread Marek Olšák
Module: Mesa
Branch: master
Commit: 94ccc31ba4f64ac480137fd90f1ded44d2072f6e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=94ccc31ba4f64ac480137fd90f1ded44d2072f6e

Author: Jakob Bornecrantz 
Date:   Wed Dec  1 05:04:25 2010 +0100

st/dri: Track drawable context bindings

Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.

---

 .../state_trackers/dri/common/dri_context.c|   10 +-
 .../state_trackers/dri/common/dri_drawable.c   |1 +
 .../state_trackers/dri/common/dri_drawable.h   |3 +++
 src/gallium/state_trackers/dri/drm/dri2.c  |2 +-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_context.c 
b/src/gallium/state_trackers/dri/common/dri_context.c
index 999b411..fc68ee1 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -141,12 +141,18 @@ GLboolean
 dri_unbind_context(__DRIcontext * cPriv)
 {
/* dri_util.c ensures cPriv is not null */
+   struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
struct dri_context *ctx = dri_context(cPriv);
+   struct dri_drawable *draw = dri_drawable(ctx->dPriv);
+   struct dri_drawable *read = dri_drawable(ctx->rPriv);
+   struct st_api *stapi = screen->st_api;
 
if (--ctx->bind_count == 0) {
   if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
  ctx->st->flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
- ctx->stapi->make_current(ctx->stapi, NULL, NULL, NULL);
+ stapi->make_current(stapi, NULL, NULL, NULL);
+ draw->context = NULL;
+ read->context = NULL;
   }
}
 
@@ -174,10 +180,12 @@ dri_make_current(__DRIcontext * cPriv,
else if (!driDrawPriv || !driReadPriv)
   return GL_FALSE;
 
+   draw->context = ctx;
if (ctx->dPriv != driDrawPriv) {
   ctx->dPriv = driDrawPriv;
   draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
+   read->context = ctx;
if (ctx->rPriv != driReadPriv) {
   ctx->rPriv = driReadPriv;
   read->texture_stamp = driReadPriv->lastStamp - 1;
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c 
b/src/gallium/state_trackers/dri/common/dri_drawable.c
index 0607486..28a33ac 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.c
@@ -132,6 +132,7 @@ dri_create_buffer(__DRIscreen * sPriv,
drawable->base.validate = dri_st_framebuffer_validate;
drawable->base.st_manager_private = (void *) drawable;
 
+   drawable->screen = screen;
drawable->sPriv = sPriv;
drawable->dPriv = dPriv;
dPriv->driverPrivate = (void *)drawable;
diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.h 
b/src/gallium/state_trackers/dri/common/dri_drawable.h
index 2ff6b71..7f1aa51 100644
--- a/src/gallium/state_trackers/dri/common/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/common/dri_drawable.h
@@ -41,6 +41,9 @@ struct dri_drawable
struct st_framebuffer_iface base;
struct st_visual stvis;
 
+   struct dri_screen *screen;
+   struct dri_context *context;
+
/* dri */
__DRIdrawable *dPriv;
__DRIscreen *sPriv;
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c 
b/src/gallium/state_trackers/dri/drm/dri2.c
index a69f20e..0181588 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -52,7 +52,7 @@ static void
 dri2_invalidate_drawable(__DRIdrawable *dPriv)
 {
struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct dri_context *ctx = dri_context(dPriv->driContextPriv);
+   struct dri_context *ctx = drawable->context;
 
dri2InvalidateDrawable(dPriv);
drawable->dPriv->lastStamp = *drawable->dPriv->pStamp;

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


Mesa (7.10): 23 new commits

2011-02-21 Thread Brian Paul
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c7adb0822664b23ad17f6c383286156ac846f47
Author: Brian Paul 
Date:   Mon Feb 21 18:05:56 2011 -0700

docs: add link to 7.10.1 release notes

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=917c44aa521ffb85dfb2fef48d9d12e2e0ddd6fa
Author: Brian Paul 
Date:   Mon Feb 21 18:05:39 2011 -0700

docs: update 7.9.2 release notes with Brian's cherry-picks

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=49a190bb0e165b1e1d5328fed463bab3a8db4255
Author: Brian Paul 
Date:   Mon Feb 21 16:54:23 2011 -0700

st/mesa: need to translate clear color according to surface's base format

When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture 
border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit e2d108ec828bdbebdc7e8f9df30c86f0b521aa8d)

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=71eee987d96bd17d27dc28b39c54ba7ff664d946
Author: Brian Paul 
Date:   Mon Feb 21 16:46:02 2011 -0700

st/mesa: fix the default case in st_format_datatype()

Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit c966c6980c2a4a1e50b238f7607a9ce111f6c0b4)

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ed0670fa9512a82d44b22e8ddd1b6f2af0303cb
Author: Brian Paul 
Date:   Fri Feb 18 10:28:27 2011 -0700

st/mesa: set renderbuffer _BaseFormat in a few places

NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit 633c9fcf781d4cc23d69d4d839cf2143ac9df1fd)

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f3f0e30e8eec872aee428aa5b90f768c156d6736
Author: Brian Paul 
Date:   Mon Feb 21 17:37:07 2011 -0700

st/mesa: fix incorrect glCopyPixels position on fallback path

If we hit the pipe_get/put_tile() path for setting up the glCopyPixels
texture we were passing the wrong x/y position to pipe_get_tile().
The x/y position was already accounted for in the pipe_get_transfer()
call so we were effectively reading from 2*readX, 2*readY.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d1becefb057ce89eeb93e130cb0d0c63de4be3d8)

Conflicts:

src/mesa/state_tracker/st_cb_drawpixels.c

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a835f586c6c189d5ac57f435c0ce0cd507802979
Author: Brian Paul 
Date:   Wed Feb 2 18:11:27 2011 -0700

cso: fix loop bound in cso_set_vertex_samplers()

Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d087cfaabf386c462329fb62f54311523a89f106)

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d91ec5322a6766ee0f19ea711d90cfd5aa7a
Author: Julien Cristau 
Date:   Wed Jan 26 04:03:17 2011 -0800

glx: fix length of GLXGetFBConfigsSGIX

The extra length is the size of the request *minus* the size of the
VendorPrivate header, not the addition.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau 
Signed-off-by: Brian Paul 
(cherry picked from commit cbe9fc12a64c3ae89fd1b20e9e165aa4b76293a5)

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=739d099d435dc8207283f4d0d87c09ce05210c14
Author: Julien Cristau 
Date:   Wed Jan 26 04:03:16 2011 -0800

glx: fix GLXChangeDrawableAttributesSGIX request

xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau 
Signed-off-by: Brian Paul 
(cherry picked from commit e27913f805acbb7d00f83ba625a8605576738a13)

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd34903790306f482d2e2a8153e77c64503c40ca
Author: Dimitry Andric 
Date:   Thu Jan 27 18:03:42 2011 -0700

glapi: add @GOTPCREL relocation type

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3ccb92f5bfb4d6f1bc3c8e712751376

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul 
(cherry picked from commit cfb9aae3ec4e42bd9be8445039dc52b8d6c71f9c)

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d15da60f3b48a1ec06de056e3d93eac4c235cd81
Author: Brian Paul 
Date:   Tue Jan 25 11:57:35 2011 -0700

softpi

Mesa (7.9): docs: add links to 7.9.1 and 7.9.2 release notes

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: c2b76d966ec0d1231f998ee0c2d514cee1f88222
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2b76d966ec0d1231f998ee0c2d514cee1f88222

Author: Brian Paul 
Date:   Mon Feb 21 18:05:18 2011 -0700

docs: add links to 7.9.1 and 7.9.2 release notes

---

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

diff --git a/docs/relnotes.html b/docs/relnotes.html
index 4487af9..bac919d 100644
--- a/docs/relnotes.html
+++ b/docs/relnotes.html
@@ -13,6 +13,8 @@ The release notes summarize what's new or changed in each 
Mesa release.
 
 
 
+7.9.2 release notes
+7.9.1 release notes
 7.9 release notes
 7.8.3 release notes
 7.8.2 release notes

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


Mesa (7.9): docs: update 7.9.2 release notes with Brian's cherry-picks

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: a28050de4f962f7728ccdcc3a68cfcabbe318713
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a28050de4f962f7728ccdcc3a68cfcabbe318713

Author: Brian Paul 
Date:   Mon Feb 21 18:05:01 2011 -0700

docs: update 7.9.2 release notes with Brian's cherry-picks

---

 docs/relnotes-7.9.2.html |   14 +-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/docs/relnotes-7.9.2.html b/docs/relnotes-7.9.2.html
index 845d933..6f3a1f0 100644
--- a/docs/relnotes-7.9.2.html
+++ b/docs/relnotes-7.9.2.html
@@ -13,7 +13,7 @@
 Mesa 7.9.2 Release Notes / TBD
 
 
-Mesa 7.9.2 is a bug fix release which fixes bugs found since the 7.9 release.
+Mesa 7.9.2 is a bug fix release which fixes bugs found since the 7.9.1 release.
 
 
 Mesa 7.9.2 implements the OpenGL 2.1 API, but the version reported by
@@ -80,6 +80,18 @@ with in, out, attribute, and 
varying.
 
 
 
+Fixed a few GLX protocol encoder bugs (Julien Cristau)
+
+https://bugs.freedesktop.org/show_bug.cgi?id=26795";>Bug 26795 
- gl_FragCoord off by one in Gallium drivers.
+
+http://bugs.freedesktop.org/show_bug.cgi?id=33433";>Bug 33433 
- Error in x86-64 API dispatch code.
+
+http://bugs.freedesktop.org/show_bug.cgi?id=33386";>Bug 33386 
and http://bugs.freedesktop.org/show_bug.cgi?id=33388";>Bug 33388 - 
bad assembly code in vertex transfomration code.
+
+Assorted Gallium llvmpipe driver bug fixes
+
+Assorted Mesa/Gallium state tracker bug fixes
+
 
 
 

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


Mesa (7.9): st/mesa: fix the default case in st_format_datatype()

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: f0eff3061c33dca7189bdd2257c6bc6a64d4c329
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0eff3061c33dca7189bdd2257c6bc6a64d4c329

Author: Brian Paul 
Date:   Mon Feb 21 16:46:02 2011 -0700

st/mesa: fix the default case in st_format_datatype()

Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit c966c6980c2a4a1e50b238f7607a9ce111f6c0b4)

---

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

diff --git a/src/mesa/state_tracker/st_format.c 
b/src/mesa/state_tracker/st_format.c
index 9506460..3b80ced 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -112,12 +112,9 @@ st_format_datatype(enum pipe_format format)
   return GL_UNSIGNED_SHORT;
}
else {
-  /* compressed format? */
-  assert(0);
+  /* probably a compressed format, unsupported anyway */
+  return GL_NONE;
}
-
-   assert(0);
-   return GL_NONE;
 }
 
 

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


Mesa (7.9): st/mesa: need to translate clear color according to surface' s base format

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 9c122ce963cbff9cce75686a45f8a55e948782da
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c122ce963cbff9cce75686a45f8a55e948782da

Author: Brian Paul 
Date:   Mon Feb 21 17:40:06 2011 -0700

st/mesa: need to translate clear color according to surface's base format

When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit e2d108ec828bdbebdc7e8f9df30c86f0b521aa8d)

Conflicts:

src/mesa/state_tracker/st_atom_sampler.c

---

 src/mesa/state_tracker/st_atom_sampler.c |   34 +--
 src/mesa/state_tracker/st_cb_clear.c |   18 --
 src/mesa/state_tracker/st_format.c   |   52 ++
 src/mesa/state_tracker/st_format.h   |6 +++
 4 files changed, 75 insertions(+), 35 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_sampler.c 
b/src/mesa/state_tracker/st_atom_sampler.c
index f147d76..474cbd5 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -36,6 +36,7 @@
 
 #include "st_context.h"
 #include "st_cb_texture.h"
+#include "st_format.h"
 #include "st_atom.h"
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
@@ -117,37 +118,6 @@ gl_filter_to_img_filter(GLenum filter)
 }
 
 
-static void
-xlate_border_color(const GLfloat *colorIn, GLenum baseFormat, GLfloat 
*colorOut)
-{
-   switch (baseFormat) {
-   case GL_RGB:
-  colorOut[0] = colorIn[0];
-  colorOut[1] = colorIn[1];
-  colorOut[2] = colorIn[2];
-  colorOut[3] = 1.0F;
-  break;
-   case GL_ALPHA:
-  colorOut[0] = colorOut[1] = colorOut[2] = 0.0;
-  colorOut[3] = colorIn[3];
-  break;
-   case GL_LUMINANCE:
-  colorOut[0] = colorOut[1] = colorOut[2] = colorIn[0];
-  colorOut[3] = 1.0;
-  break;
-   case GL_LUMINANCE_ALPHA:
-  colorOut[0] = colorOut[1] = colorOut[2] = colorIn[0];
-  colorOut[3] = colorIn[3];
-  break;
-   case GL_INTENSITY:
-  colorOut[0] = colorOut[1] = colorOut[2] = colorOut[3] = colorIn[0];
-  break;
-   default:
-  COPY_4V(colorOut, colorIn);
-   }
-}
-
-
 static void 
 update_samplers(struct st_context *st)
 {
@@ -211,7 +181,7 @@ update_samplers(struct st_context *st)
 assert(sampler->min_lod <= sampler->max_lod);
  }
 
- xlate_border_color(texobj->BorderColor.f,
+ st_translate_color(texobj->BorderColor.f,
 teximg ? teximg->_BaseFormat : GL_RGBA,
 sampler->border_color);
 
diff --git a/src/mesa/state_tracker/st_cb_clear.c 
b/src/mesa/state_tracker/st_cb_clear.c
index 00489c6..fd7bfc4 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -42,6 +42,7 @@
 #include "st_cb_accum.h"
 #include "st_cb_clear.h"
 #include "st_cb_fbo.h"
+#include "st_format.h"
 #include "st_program.h"
 
 #include "pipe/p_context.h"
@@ -202,6 +203,7 @@ clear_with_quad(GLcontext *ctx,
const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 
1.0f;
const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 
1.0f;
const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax / fb_height * 2.0f - 
1.0f;
+   float clearColor[4];
 
/*
printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__, 
@@ -295,9 +297,12 @@ clear_with_quad(GLcontext *ctx,
cso_set_fragment_shader_handle(st->cso_context, st->clear.fs);
cso_set_vertex_shader_handle(st->cso_context, st->clear.vs);
 
-   /* draw quad matching scissor rect (XXX verify coord round-off) */
-   draw_quad(st, x0, y0, x1, y1,
- (GLfloat) ctx->Depth.Clear, ctx->Color.ClearColor);
+   st_translate_color(ctx->Color.ClearColor,
+  ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
+  clearColor);
+
+   /* draw quad matching scissor rect */
+   draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, clearColor);
 
/* Restore pipe state */
cso_restore_blend(st->cso_context);
@@ -537,12 +542,19 @@ st_Clear(GLcontext *ctx, GLbitfield mask)
* required from the visual. Hence fix this up to avoid potential
* read-modify-write in the driver.
*/
+  float clearColor[4];
+
   if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&
   ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != 
PIPE_CLEAR_DEPTHSTENCIL) &&
   (depthRb == stencilRb) &&
   (ctx->DrawBuffer->Visual.depthBits == 0 ||
ctx->DrawBuffer->Visual.stencilBits == 0))
  clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
+
+  st_translate_color(ctx->Color.ClearColor,
+ ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
+

Mesa (7.9): st/mesa: set renderbuffer _BaseFormat in a few places

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 5a79a6dc04a32ac17e20673086f81de77bc7b543
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a79a6dc04a32ac17e20673086f81de77bc7b543

Author: Brian Paul 
Date:   Fri Feb 18 10:28:27 2011 -0700

st/mesa: set renderbuffer _BaseFormat in a few places

NOTE: This is a candidate for the 7.9 and 7.10 branches
(cherry picked from commit 633c9fcf781d4cc23d69d4d839cf2143ac9df1fd)

---

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

diff --git a/src/mesa/state_tracker/st_cb_fbo.c 
b/src/mesa/state_tracker/st_cb_fbo.c
index 71bd472..ce64a73 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -78,6 +78,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct 
gl_renderbuffer *rb,
strb->Base.Width  = width;
strb->Base.Height = height;
strb->Base.Format = st_pipe_format_to_mesa_format(format);
+   strb->Base._BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
strb->Base.DataType = st_format_datatype(format);
 
strb->defined = GL_FALSE;  /* undefined contents now */
@@ -226,6 +227,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int 
samples, boolean sw)
strb->Base.ClassID = 0x4242; /* just a unique value */
strb->Base.NumSamples = samples;
strb->Base.Format = st_pipe_format_to_mesa_format(format);
+   strb->Base._BaseFormat = _mesa_get_format_base_format(strb->Base.Format);
strb->Base.DataType = st_format_datatype(format);
strb->format = format;
strb->software = sw;

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


Mesa (7.9): cso: fix loop bound in cso_set_vertex_samplers()

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 652ceece0e01be9e481b468359c32b8a4506b661
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=652ceece0e01be9e481b468359c32b8a4506b661

Author: Brian Paul 
Date:   Wed Feb  2 18:11:27 2011 -0700

cso: fix loop bound in cso_set_vertex_samplers()

Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit d087cfaabf386c462329fb62f54311523a89f106)

---

 src/gallium/auxiliary/cso_cache/cso_context.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c 
b/src/gallium/auxiliary/cso_cache/cso_context.c
index 58b022d..b983fa6 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -595,7 +595,7 @@ enum pipe_error cso_set_vertex_samplers(struct cso_context 
*ctx,
  error = temp;
}
 
-   for ( ; i < ctx->nr_samplers; i++) {
+   for ( ; i < ctx->nr_vertex_samplers; i++) {
   temp = cso_single_vertex_sampler( ctx, i, NULL );
   if (temp != PIPE_OK)
  error = temp;

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


Mesa (7.9): glx: fix length of GLXGetFBConfigsSGIX

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: e39aa1966b95537b31d58740e0907c824ac65430
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e39aa1966b95537b31d58740e0907c824ac65430

Author: Julien Cristau 
Date:   Wed Jan 26 04:03:17 2011 -0800

glx: fix length of GLXGetFBConfigsSGIX

The extra length is the size of the request *minus* the size of the
VendorPrivate header, not the addition.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau 
Signed-off-by: Brian Paul 
(cherry picked from commit cbe9fc12a64c3ae89fd1b20e9e165aa4b76293a5)

---

 src/glx/glxext.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index c5e9d05..c75c9bf 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -688,7 +688,7 @@ static GLboolean
}
else if (strstr(psc->serverGLXexts, "GLX_SGIX_fbconfig") != NULL) {
   GetReqExtra(GLXVendorPrivateWithReply,
-  sz_xGLXGetFBConfigsSGIXReq +
+  sz_xGLXGetFBConfigsSGIXReq -
   sz_xGLXVendorPrivateWithReplyReq, vpreq);
   sgi_req = (xGLXGetFBConfigsSGIXReq *) vpreq;
   sgi_req->reqType = priv->majorOpcode;

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


Mesa (7.9): glx: fix GLXChangeDrawableAttributesSGIX request

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: ba764ae5b116efcbba26b64675a590264c89e187
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba764ae5b116efcbba26b64675a590264c89e187

Author: Julien Cristau 
Date:   Wed Jan 26 04:03:16 2011 -0800

glx: fix GLXChangeDrawableAttributesSGIX request

xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau 
Signed-off-by: Brian Paul 
(cherry picked from commit e27913f805acbb7d00f83ba625a8605576738a13)

---

 src/glx/glx_pbuffer.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 1de3e74..5f91bc6 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -117,7 +117,7 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
else {
   xGLXVendorPrivateWithReplyReq *vpreq;
 
-  GetReqExtra(GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq);
+  GetReqExtra(GLXVendorPrivateWithReply, 8 + (8 * num_attribs), vpreq);
   output = (CARD32 *) (vpreq + 1);
 
   vpreq->reqType = opcode;
@@ -125,7 +125,8 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
   vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX;
 
   output[0] = (CARD32) drawable;
-  output++;
+  output[1] = num_attribs;
+  output += 2;
}
 
(void) memcpy(output, attribs, sizeof(CARD32) * 2 * num_attribs);

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


Mesa (7.9): glapi: add @GOTPCREL relocation type

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 3959f9f7c8487ad424096d2fe26f368180fb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3959f9f7c8487ad424096d2fe26f368180fb

Author: Dimitry Andric 
Date:   Thu Jan 27 18:03:42 2011 -0700

glapi: add @GOTPCREL relocation type

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3ccb92f5bfb4d6f1bc3c8e712751376

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul 
(cherry picked from commit cfb9aae3ec4e42bd9be8445039dc52b8d6c71f9c)

---

 src/mapi/glapi/gen/gl_x86-64_asm.py |3 ++-
 src/mapi/glapi/glapi_x86-64.S   |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py 
b/src/mapi/glapi/gen/gl_x86-64_asm.py
index e6e78c4..0fc405c 100644
--- a/src/mapi/glapi/gen/gl_x86-64_asm.py
+++ b/src/mapi/glapi/gen/gl_x86-64_asm.py
@@ -166,7 +166,8 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print ''
print '\t.p2align\t4,,15'
print '_x86_64_get_dispatch:'
-   print '\tmovq\t_gl_DispatchTSD(%rip), %rdi'
+   print '\tmovq\t_gl_DispatchTSD@GOTPCREL(%rip), %rax'
+   print '\tmovl\t(%rax), %edi'
print '\tjmp\tpthread_getspecific@PLT'
print ''
print '#elif defined(THREADS)'
diff --git a/src/mapi/glapi/glapi_x86-64.S b/src/mapi/glapi/glapi_x86-64.S
index 8cfd815..8e69d63 100644
--- a/src/mapi/glapi/glapi_x86-64.S
+++ b/src/mapi/glapi/glapi_x86-64.S
@@ -73,7 +73,8 @@ _x86_64_get_dispatch:
 
.p2align4,,15
 _x86_64_get_dispatch:
-   movq_gl_DispatchTSD(%rip), %rdi
+   movq_gl_DispatchTSD@GOTPCREL(%rip), %rax
+   movl(%rax), %edi
jmp pthread_getspecific@PLT
 
 #elif defined(THREADS)

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


Mesa (7.9): softpipe: fix off-by-one error in setup_fragcoord_coeff()

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: fa5c4b988a750ec1fd84ab355d4dac83bbd74f13
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa5c4b988a750ec1fd84ab355d4dac83bbd74f13

Author: Brian Paul 
Date:   Tue Jan 25 11:57:35 2011 -0700

softpipe: fix off-by-one error in setup_fragcoord_coeff()

If we invert Y, need to subtract one from the surface height.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=26795
for softpipe.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 40ac24e631e694e00652a2df6c0ac5d0f07f620f)

---

 src/gallium/drivers/softpipe/sp_setup.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_setup.c 
b/src/gallium/drivers/softpipe/sp_setup.c
index 5d727dc..0ce28f4 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -575,7 +575,7 @@ setup_fragcoord_coeff(struct setup_context *setup, uint 
slot)
setup->coef[slot].dady[0] = 0.0;
/*Y*/
setup->coef[slot].a0[1] =
-  (spfs->origin_lower_left ? 
setup->softpipe->framebuffer.height : 0)
+  (spfs->origin_lower_left ? 
setup->softpipe->framebuffer.height-1 : 0)
   + (spfs->pixel_center_integer ? 0.0 : 0.5);
setup->coef[slot].dadx[1] = 0.0;
setup->coef[slot].dady[1] = spfs->origin_lower_left ? -1.0 : 1.0;

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


Mesa (7.9): st/mesa: fix incorrect fragcoord.x translation

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 0a218b00e7deeea0c217c5854eda0b667d98384a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a218b00e7deeea0c217c5854eda0b667d98384a

Author: Brian Paul 
Date:   Tue Jan 25 11:54:05 2011 -0700

st/mesa: fix incorrect fragcoord.x translation

emit_adjusted_wpos() needs separate x,y translation values.  If we
invert Y, we don't want to effect X.

Part of the fix for http://bugs.freedesktop.org/show_bug.cgi?id=26795

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit bb56631f0cb6b3fc552a72e0165816909bf6fdc9)

---

 src/mesa/state_tracker/st_mesa_to_tgsi.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c 
b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 2712717..81980f7 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -739,10 +739,12 @@ compile_instruction(
 
 /**
  * Emit the TGSI instructions to adjust the WPOS pixel center convention
+ * Basically, add (adjX, adjY) to the fragment position.
  */
 static void
 emit_adjusted_wpos( struct st_translate *t,
-const struct gl_program *program, GLfloat value)
+const struct gl_program *program,
+GLfloat adjX, GLfloat adjY)
 {
struct ureg_program *ureg = t->ureg;
struct ureg_dst wpos_temp = ureg_DECL_temporary(ureg);
@@ -752,7 +754,7 @@ emit_adjusted_wpos( struct st_translate *t,
 * The shader might also use gl_FragCoord.w and .z.
 */
ureg_ADD(ureg, wpos_temp, wpos_input,
-ureg_imm4f(ureg, value, value, 0.0f, 0.0f));
+ureg_imm4f(ureg, adjX, adjY, 0.0f, 0.0f));
 
t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp);
 }
@@ -858,7 +860,7 @@ emit_wpos(struct st_context *st,
   if (pscreen->get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER))
  ureg_property_fs_coord_pixel_center(ureg, 
TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
   else if (pscreen->get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER))
- emit_adjusted_wpos(t, program, invert ? 0.5f : -0.5f);
+ emit_adjusted_wpos(t, program, 0.5f, invert ? 0.5f : -0.5f);
   else
  assert(0);
}
@@ -867,7 +869,7 @@ emit_wpos(struct st_context *st,
   }
   else if (pscreen->get_param(pscreen, 
PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) {
  ureg_property_fs_coord_pixel_center(ureg, 
TGSI_FS_COORD_PIXEL_CENTER_INTEGER);
- emit_adjusted_wpos(t, program, invert ? -0.5f : 0.5f);
+ emit_adjusted_wpos(t, program, 0.5f, invert ? -0.5f : 0.5f);
   }
   else
  assert(0);

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


Mesa (7.9): glapi: adding @ char before type specifier in glapi_x86.S

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 8198e26969fdc4b76ab2a2819ddb929b1f94acb4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8198e26969fdc4b76ab2a2819ddb929b1f94acb4

Author: Dimitry Andric 
Date:   Tue Jan 25 09:23:44 2011 -0700

glapi: adding @ char before type specifier in glapi_x86.S

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33433
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul 
(cherry picked from commit 37bffe8d128bd00343169188c9af4852bbd4783e)

---

 src/mapi/glapi/gen/gl_x86_asm.py |2 +-
 src/mapi/glapi/glapi_x86.S   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py
index 10dfa1d..fbb9463 100644
--- a/src/mapi/glapi/gen/gl_x86_asm.py
+++ b/src/mapi/glapi/gen/gl_x86_asm.py
@@ -74,7 +74,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))'
print ''
print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && 
!defined(__MINGW32__) && !defined(__APPLE__)'
-   print '#define GLOBL_FN(x) GLOBL x ; .type x, function'
+   print '#define GLOBL_FN(x) GLOBL x ; .type x, @function'
print '#else'
print '#define GLOBL_FN(x) GLOBL x'
print '#endif'
diff --git a/src/mapi/glapi/glapi_x86.S b/src/mapi/glapi/glapi_x86.S
index 8b764c9..163ec29 100644
--- a/src/mapi/glapi/glapi_x86.S
+++ b/src/mapi/glapi/glapi_x86.S
@@ -47,7 +47,7 @@
 #define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))
 
 #if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && 
!defined(__APPLE__)
-#define GLOBL_FN(x) GLOBL x ; .type x, function
+#define GLOBL_FN(x) GLOBL x ; .type x, @function
 #else
 #define GLOBL_FN(x) GLOBL x
 #endif

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


Mesa (7.9): glx: fix request lengths

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 1b641f1b3226c855be4c341b1f049ca3a60a840c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b641f1b3226c855be4c341b1f049ca3a60a840c

Author: Julien Cristau 
Date:   Sun Jan 23 08:26:35 2011 -0800

glx: fix request lengths

We were sending too long requests for GLXChangeDrawableAttributes,
GLXGetDrawableAttributes, GLXDestroyPixmap and GLXDestroyWindow.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau 
Signed-off-by: Brian Paul 
(cherry picked from commit 4324d6fdfbba17e66b476cf008713d26cac83ad1)

---

 src/glx/glx_pbuffer.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 34892e8..1de3e74 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -106,7 +106,7 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
   xGLXChangeDrawableAttributesReq *req;
 
-  GetReqExtra(GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req);
+  GetReqExtra(GLXChangeDrawableAttributes, 8 * num_attribs, req);
   output = (CARD32 *) (req + 1);
 
   req->reqType = opcode;
@@ -297,7 +297,7 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
if (use_glx_1_3) {
   xGLXGetDrawableAttributesReq *req;
 
-  GetReqExtra(GLXGetDrawableAttributes, 4, req);
+  GetReq(GLXGetDrawableAttributes, req);
   req->reqType = opcode;
   req->glxCode = X_GLXGetDrawableAttributes;
   req->drawable = drawable;
@@ -435,7 +435,7 @@ DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 
glxCode)
 
LockDisplay(dpy);
 
-   GetReqExtra(GLXDestroyPbuffer, 4, req);
+   GetReq(GLXDestroyPbuffer, req);
req->reqType = opcode;
req->glxCode = glxCode;
req->pbuffer = (GLXPbuffer) drawable;

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


Mesa (7.9): mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 8a9e6a57d0536497892e0d2d23cfb427cede5547
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8a9e6a57d0536497892e0d2d23cfb427cede5547

Author: Dimitry Andric 
Date:   Mon Jan 24 14:36:37 2011 -0700

mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33386
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul 
(cherry picked from commit 811ee32a9ef177bec46c82692eeac8bc7297753c)

---

 src/mesa/x86/read_rgba_span_x86.S |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/x86/read_rgba_span_x86.S 
b/src/mesa/x86/read_rgba_span_x86.S
index 3886a51..8177299 100644
--- a/src/mesa/x86/read_rgba_span_x86.S
+++ b/src/mesa/x86/read_rgba_span_x86.S
@@ -648,7 +648,7 @@ _generic_read_RGBA_span_RGB565_MMX:
testl   $0x01, %ecx
je  .L01
 
-   movzxw  (%eax), %ecx
+   movzwl  (%eax), %ecx
movd%ecx, %mm4
 
pshufw  $0x00, %mm4, %mm0

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


Mesa (7.9): mesa: s/movzx/movzbl/

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 279c03b98f2014bde3bb19c020437d707e96ef58
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=279c03b98f2014bde3bb19c020437d707e96ef58

Author: Dimitry Andric 
Date:   Mon Jan 24 14:34:10 2011 -0700

mesa: s/movzx/movzbl/

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33388
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul 
(cherry picked from commit 3fda80246f0c41edebdfb4b1ce35bb4726a8c521)

---

 src/mesa/x86-64/xform4.S |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S
index e52a611..6141e43 100644
--- a/src/mesa/x86-64/xform4.S
+++ b/src/mesa/x86-64/xform4.S
@@ -55,7 +55,7 @@ _mesa_x86_64_transform_points4_general:
  * rdx = source
  */
movl V4F_COUNT(%rdx), %ecx  /* count */
-   movzx V4F_STRIDE(%rdx), %eax/* stride */
+   movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
movl %ecx, V4F_COUNT(%rdi)  /* set dest count */
movl $4, V4F_SIZE(%rdi) /* set dest size */
@@ -138,7 +138,7 @@ _mesa_x86_64_transform_points4_3d:
movaps 16(%rax), %xmm10
 
movl V4F_COUNT(%rdx), %ecx  /* count */
-   movzx V4F_STRIDE(%rdx), %eax/* stride */
+   movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
movl %ecx, V4F_COUNT(%rdi)  /* set dest count */
movl $4, V4F_SIZE(%rdi) /* set dest size */
@@ -199,7 +199,7 @@ p4_3d_done:
 _mesa_x86_64_transform_points4_identity:
 
movl V4F_COUNT(%rdx), %ecx  /* count */
-   movzx V4F_STRIDE(%rdx), %eax/* stride */
+   movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
movl %ecx, V4F_COUNT(%rdi)  /* set dest count */
movl $4, V4F_SIZE(%rdi) /* set dest size */
@@ -228,7 +228,7 @@ p4_identity_done:
 _mesa_3dnow_transform_points4_3d_no_rot:
 
movl V4F_COUNT(%rdx), %ecx  /* count */
-   movzx V4F_STRIDE(%rdx), %eax/* stride */
+   movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
movl %ecx, V4F_COUNT(%rdi)  /* set dest count */
movl $4, V4F_SIZE(%rdi) /* set dest size */
@@ -293,7 +293,7 @@ p4_3d_no_rot_done:
 _mesa_3dnow_transform_points4_perspective:
 
movl V4F_COUNT(%rdx), %ecx  /* count */
-   movzx V4F_STRIDE(%rdx), %eax/* stride */
+   movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
movl %ecx, V4F_COUNT(%rdi)  /* set dest count */
movl $4, V4F_SIZE(%rdi) /* set dest size */
@@ -360,7 +360,7 @@ p4_perspective_done:
 _mesa_3dnow_transform_points4_2d_no_rot:
 
movl V4F_COUNT(%rdx), %ecx  /* count */
-   movzx V4F_STRIDE(%rdx), %eax/* stride */
+   movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
movl %ecx, V4F_COUNT(%rdi)  /* set dest count */
movl $4, V4F_SIZE(%rdi) /* set dest size */
@@ -416,7 +416,7 @@ p4_2d_no_rot_done:
 _mesa_3dnow_transform_points4_2d:
 
movl V4F_COUNT(%rdx), %ecx  /* count */
-   movzx V4F_STRIDE(%rdx), %eax/* stride */
+   movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
movl %ecx, V4F_COUNT(%rdi)  /* set dest count */
movl $4, V4F_SIZE(%rdi) /* set dest size */

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


Mesa (7.9): llvmpipe: make sure binning is active when we begin/end a query

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: edfe056747a40f04a93515d7cb6963d85a7e7b76
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=edfe056747a40f04a93515d7cb6963d85a7e7b76

Author: Brian Paul 
Date:   Wed Jan 12 16:13:13 2011 -0700

llvmpipe: make sure binning is active when we begin/end a query

This fixes a potential failure when a begin/end_query is the first
thing to happen after flushing the scene.

NOTE: This is a candidate for the 7.10 and 7.9 branches.
(cherry picked from commit 42dbc2530b5a2263012f3fa0e48517a1b8db1c52)

---

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

diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c 
b/src/gallium/drivers/llvmpipe/lp_setup.c
index e6a8196..0062418 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -975,6 +975,8 @@ lp_setup_begin_query(struct lp_setup_context *setup,
 {
/* init the query to its beginning state */
assert(setup->active_query == NULL);
+
+   set_scene_state(setup, SETUP_ACTIVE, "begin_query");

if (setup->scene) {
   if (!lp_scene_bin_everywhere(setup->scene,
@@ -1004,6 +1006,8 @@ lp_setup_end_query(struct lp_setup_context *setup, struct 
llvmpipe_query *pq)
 {
union lp_rast_cmd_arg dummy = { 0 };
 
+   set_scene_state(setup, SETUP_ACTIVE, "end_query");
+
assert(setup->active_query == pq);
setup->active_query = NULL;
 

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


Mesa (7.9): mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 8ad9670866c5c4e4360741f262054502e86d801c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ad9670866c5c4e4360741f262054502e86d801c

Author: Brian Paul 
Date:   Wed Jan 12 18:14:14 2011 -0700

mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()

Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit dd973cd9e81abf1c0bc1880c7905f3277d4361a0)

---

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

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index a946e3f..cb49828 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1870,6 +1870,13 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum 
attachment,
  " renderbuffer %u)", renderbuffer);
 return;
   }
+  else if (rb == &DummyRenderbuffer) {
+ /* This is what NVIDIA does */
+_mesa_error(ctx, GL_INVALID_VALUE,
+"glFramebufferRenderbufferEXT(renderbuffer %u)",
+ renderbuffer);
+return;
+  }
}
else {
   /* remove renderbuffer attachment */

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


Mesa (7.9): mesa: don't assert in GetIntegerIndexed, etc

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 09cb5815aec1d5562a40ad5612d7e1dd9f598de5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=09cb5815aec1d5562a40ad5612d7e1dd9f598de5

Author: Brian Paul 
Date:   Wed Jan 12 18:12:46 2011 -0700

mesa: don't assert in GetIntegerIndexed, etc

We were getting an assertion upon invalid pname.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 67722ae403526d8b267e29ed2ac962b806001ce5)

---

 src/mesa/main/get.c |   18 --
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 4524a41..596d7d2 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2346,8 +2346,10 @@ void GLAPIENTRY
 _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params )
 {
union value v;
+   enum value_type type =
+  find_value_indexed("glGetBooleanIndexedv", pname, index, &v);
 
-   switch (find_value_indexed("glGetBooleanIndexedv", pname, index, &v)) {
+   switch (type) {
case TYPE_INT:
   params[0] = INT_TO_BOOLEAN(v.value_int);
   break;
@@ -2361,7 +2363,7 @@ _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, 
GLboolean *params )
   params[0] = INT64_TO_BOOLEAN(v.value_int);
   break;
default:
-  assert(0);
+  ; /* nothing - GL error was recorded */
}
 }
 
@@ -2369,8 +2371,10 @@ void GLAPIENTRY
 _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params )
 {
union value v;
+   enum value_type type =
+  find_value_indexed("glGetIntegerIndexedv", pname, index, &v);
 
-   switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) {
+   switch (type) {
case TYPE_INT:
   params[0] = v.value_int;
   break;
@@ -2384,7 +2388,7 @@ _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, 
GLint *params )
   params[0] = INT64_TO_INT(v.value_int);
   break;
default:
-  assert(0);
+  ; /* nothing - GL error was recorded */
}
 }
 
@@ -2393,8 +2397,10 @@ void GLAPIENTRY
 _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
 {
union value v;
+   enum value_type type =
+  find_value_indexed("glGetIntegerIndexedv", pname, index, &v);  
 
-   switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) {
+   switch (type) {
case TYPE_INT:
   params[0] = v.value_int;
   break;
@@ -2408,7 +2414,7 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, 
GLint64 *params )
   params[0] = v.value_int;
   break;
default:
-  assert(0);
+  ; /* nothing - GL error was recorded */
}
 }
 #endif /* FEATURE_ARB_sync */

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


Mesa (7.9): mesa: fix num_draw_buffers== 0 in fixed-function fragment program generation

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: d1424f0185fda236fe90f181d135bf86d03f0c6f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1424f0185fda236fe90f181d135bf86d03f0c6f

Author: Brian Paul 
Date:   Wed Jan 12 17:32:00 2011 -0700

mesa: fix num_draw_buffers==0 in fixed-function fragment program generation

This fixes a problem when glDrawBuffers(GL_NONE).  The fragment program
was writing to color output[0] but OutputsWritten was 0.  That led to a
failed assertion in the Mesa->TGSI translation code.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 2fa6012f6a0b02de6093cbccba3bf4432f072e57)

---

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

diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 20f02ce..b1849d8 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -1465,7 +1465,7 @@ create_new_program(GLcontext *ctx, struct state_key *key,
p.last_tex_stage = 0;
release_temps(ctx, &p);
 
-   if (key->enabled_units) {
+   if (key->enabled_units && key->num_draw_buffers) {
   GLboolean needbumpstage = GL_FALSE;
 
   /* Zeroth pass - bump map textures first */
@@ -1558,7 +1558,7 @@ create_new_program(GLcontext *ctx, struct state_key *key,
_mesa_copy_instructions(p.program->Base.Instructions, instBuffer,
p.program->Base.NumInstructions);
 
-   if (p.program->FogOption) {
+   if (key->num_draw_buffers && p.program->FogOption) {
   _mesa_append_fog_code(ctx, p.program);
   p.program->FogOption = GL_NONE;
}

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


Mesa (7.9): mesa: fix a few format table mistakes, assertions

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: 7.9
Commit: 7e43495053fe4d9ba577aee15b83786dddf8384b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e43495053fe4d9ba577aee15b83786dddf8384b

Author: Brian Paul 
Date:   Tue Jan 11 09:23:45 2011 -0700

mesa: fix a few format table mistakes, assertions

The BaseFormat field was incorrect for a few R and RG formats.
Fix a couple assertions too.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 0073f50cd47c48c706b4524364b9c0594804febf)

---

 src/mesa/main/formats.c |   15 ---
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index c3fe8a3..14e5dde 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -702,7 +702,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] 
=
{
   MESA_FORMAT_SIGNED_R8,/* Name */
   "MESA_FORMAT_SIGNED_R8",  /* StrName */
-  GL_RGBA,  /* BaseFormat */
+  GL_RED,   /* BaseFormat */
   GL_SIGNED_NORMALIZED, /* DataType */
   8, 0, 0, 0,   /* Red/Green/Blue/AlphaBits */
   0, 0, 0, 0, 0,/* Lum/Int/Index/Depth/StencilBits */
@@ -711,7 +711,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] 
=
{
   MESA_FORMAT_SIGNED_RG88,
   "MESA_FORMAT_SIGNED_RG88",
-  GL_RGBA,
+  GL_RG,
   GL_SIGNED_NORMALIZED,
   8, 8, 0, 0,
   0, 0, 0, 0, 0,
@@ -720,7 +720,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] 
=
{
   MESA_FORMAT_SIGNED_RGBX,
   "MESA_FORMAT_SIGNED_RGBX",
-  GL_RGBA,
+  GL_RGB,
   GL_SIGNED_NORMALIZED,
   8, 8, 8, 0,
   0, 0, 0, 0, 0,
@@ -749,7 +749,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] 
=
{
   MESA_FORMAT_SIGNED_R_16,
   "MESA_FORMAT_SIGNED_R_16",
-  GL_RGBA,
+  GL_RED,
   GL_SIGNED_NORMALIZED,
   16, 0, 0, 0,
   0, 0, 0, 0, 0,
@@ -758,7 +758,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] 
=
{
   MESA_FORMAT_SIGNED_RG_16,
   "MESA_FORMAT_SIGNED_RG_16",
-  GL_RGBA,
+  GL_RG,
   GL_SIGNED_NORMALIZED,
   16, 16, 0, 0,
   0, 0, 0, 0, 0,
@@ -767,7 +767,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] 
=
{
   MESA_FORMAT_SIGNED_RGB_16,
   "MESA_FORMAT_SIGNED_RGB_16",
-  GL_RGBA,
+  GL_RGB,
   GL_SIGNED_NORMALIZED,
   16, 16, 16, 0,
   0, 0, 0, 0, 0,
@@ -1047,7 +1047,7 @@ _mesa_test_formats(void)
  if (info->RedBits > 0) {
 GLuint t = info->RedBits + info->GreenBits
+ info->BlueBits + info->AlphaBits;
-assert(t / 8 == info->BytesPerBlock);
+assert(t / 8 <= info->BytesPerBlock);
 (void) t;
  }
   }
@@ -1055,6 +1055,7 @@ _mesa_test_formats(void)
   assert(info->DataType == GL_UNSIGNED_NORMALIZED ||
  info->DataType == GL_SIGNED_NORMALIZED ||
  info->DataType == GL_UNSIGNED_INT ||
+ info->DataType == GL_INT ||
  info->DataType == GL_FLOAT);
 
   if (info->BaseFormat == GL_RGB) {

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


Mesa (master): i965: Fix VB packet reuse when offset for the new buffer isn 't stride aligned.

2011-02-21 Thread Eric Anholt
Module: Mesa
Branch: master
Commit: 9e872a5865c66ed0a518dd1c6c54e72f3afa71f1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e872a5865c66ed0a518dd1c6c54e72f3afa71f1

Author: Eric Anholt 
Date:   Mon Feb 21 16:24:41 2011 -0800

i965: Fix VB packet reuse when offset for the new buffer isn't stride aligned.

Fixes regression in scissor-stencil-clear and 5 other tests.

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c 
b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 17af046..b15c05a 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -470,7 +470,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
 d = brw->vb.buffers[i].offset - brw->vb.current_buffers[i].offset;
 if (delta == 0)
delta = d / brw->vb.current_buffers[i].stride;
-else if (delta * brw->vb.current_buffers[i].stride != d)
+if (delta * brw->vb.current_buffers[i].stride != d)
break;
   }
 

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


Mesa (master): Revert "mesa: convert macros to inline functions"

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 12f25eb6d5521ad2dc61eab08331c1ea8d3c67f7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=12f25eb6d5521ad2dc61eab08331c1ea8d3c67f7

Author: Brian Paul 
Date:   Mon Feb 21 17:01:00 2011 -0700

Revert "mesa: convert macros to inline functions"

This reverts commit e9ff76aa81d9bd973d46b7e46f1e4ece2112a5b7.

Need to use macros so __FUNCTION__ reports the caller.

---

 src/mesa/main/context.h |   44 ++--
 1 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 8c115c7..4e391dd 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -192,41 +192,41 @@ _mesa_Flush( void );
 
 /**
  * Flush vertices.
- * \param newstate  bitmask of _NEW_x flags
+ *
+ * \param ctx GL context.
+ * \param newstate new state.
  *
  * Checks if dd_function_table::NeedFlush is marked to flush stored vertices,
  * and calls dd_function_table::FlushVertices if so. Marks
  * __struct gl_contextRec::NewState with \p newstate.
  */
-static INLINE void
-FLUSH_VERTICES(struct gl_context *ctx, GLbitfield newstate)
-{
-   if (MESA_VERBOSE & VERBOSE_STATE)
-  _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);
-   if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES)
-  ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES);
-   ctx->NewState |= newstate;
-}
-
+#define FLUSH_VERTICES(ctx, newstate)  \
+do {   \
+   if (MESA_VERBOSE & VERBOSE_STATE)   \
+  _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
+   if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES)  \
+  ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES);   \
+   ctx->NewState |= newstate;  \
+} while (0)
 
 /**
  * Flush current state.
- * \param newstate  bitmask of _NEW_x flags
+ *
+ * \param ctx GL context.
+ * \param newstate new state.
  *
  * Checks if dd_function_table::NeedFlush is marked to flush current state,
  * and calls dd_function_table::FlushVertices if so. Marks
  * __struct gl_contextRec::NewState with \p newstate.
  */
-static INLINE void
-FLUSH_CURRENT(struct gl_context *ctx, GLbitfield newstate)
-{
-   if (MESA_VERBOSE & VERBOSE_STATE)
-  _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION);
-   if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
-  ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT);
-   ctx->NewState |= newstate;
-}
-
+#define FLUSH_CURRENT(ctx, newstate)   \
+do {   \
+   if (MESA_VERBOSE & VERBOSE_STATE)   \
+  _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION);\
+   if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)   \
+  ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT);\
+   ctx->NewState |= newstate;  \
+} while (0)
 
 /**
  * Macro to assert that the API call was made outside the

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


Mesa (master): st/mesa: need to translate clear color according to surface' s base format

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: e2d108ec828bdbebdc7e8f9df30c86f0b521aa8d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e2d108ec828bdbebdc7e8f9df30c86f0b521aa8d

Author: Brian Paul 
Date:   Mon Feb 21 16:54:23 2011 -0700

st/mesa: need to translate clear color according to surface's base format

When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

---

 src/mesa/state_tracker/st_atom_sampler.c |   46 +-
 src/mesa/state_tracker/st_cb_clear.c |   18 --
 src/mesa/state_tracker/st_format.c   |   52 ++
 src/mesa/state_tracker/st_format.h   |6 +++
 4 files changed, 75 insertions(+), 47 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_sampler.c 
b/src/mesa/state_tracker/st_atom_sampler.c
index b67068d..474cbd5 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -36,6 +36,7 @@
 
 #include "st_context.h"
 #include "st_cb_texture.h"
+#include "st_format.h"
 #include "st_atom.h"
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
@@ -117,49 +118,6 @@ gl_filter_to_img_filter(GLenum filter)
 }
 
 
-static void
-xlate_border_color(const GLfloat *colorIn, GLenum baseFormat, GLfloat 
*colorOut)
-{
-   switch (baseFormat) {
-   case GL_RED:
-  colorOut[0] = colorIn[0];
-  colorOut[1] = 0.0F;
-  colorOut[2] = 0.0F;
-  colorOut[3] = 1.0F;
-  break;
-   case GL_RG:
-  colorOut[0] = colorIn[0];
-  colorOut[1] = colorIn[1];
-  colorOut[2] = 0.0F;
-  colorOut[3] = 1.0F;
-  break;
-   case GL_RGB:
-  colorOut[0] = colorIn[0];
-  colorOut[1] = colorIn[1];
-  colorOut[2] = colorIn[2];
-  colorOut[3] = 1.0F;
-  break;
-   case GL_ALPHA:
-  colorOut[0] = colorOut[1] = colorOut[2] = 0.0;
-  colorOut[3] = colorIn[3];
-  break;
-   case GL_LUMINANCE:
-  colorOut[0] = colorOut[1] = colorOut[2] = colorIn[0];
-  colorOut[3] = 1.0;
-  break;
-   case GL_LUMINANCE_ALPHA:
-  colorOut[0] = colorOut[1] = colorOut[2] = colorIn[0];
-  colorOut[3] = colorIn[3];
-  break;
-   case GL_INTENSITY:
-  colorOut[0] = colorOut[1] = colorOut[2] = colorOut[3] = colorIn[0];
-  break;
-   default:
-  COPY_4V(colorOut, colorIn);
-   }
-}
-
-
 static void 
 update_samplers(struct st_context *st)
 {
@@ -223,7 +181,7 @@ update_samplers(struct st_context *st)
 assert(sampler->min_lod <= sampler->max_lod);
  }
 
- xlate_border_color(texobj->BorderColor.f,
+ st_translate_color(texobj->BorderColor.f,
 teximg ? teximg->_BaseFormat : GL_RGBA,
 sampler->border_color);
 
diff --git a/src/mesa/state_tracker/st_cb_clear.c 
b/src/mesa/state_tracker/st_cb_clear.c
index d2e0cd7..d81e554 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -42,6 +42,7 @@
 #include "st_cb_accum.h"
 #include "st_cb_clear.h"
 #include "st_cb_fbo.h"
+#include "st_format.h"
 #include "st_program.h"
 
 #include "pipe/p_context.h"
@@ -204,6 +205,7 @@ clear_with_quad(struct gl_context *ctx,
const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 
1.0f;
const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 
1.0f;
const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax / fb_height * 2.0f - 
1.0f;
+   float clearColor[4];
 
/*
printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__, 
@@ -298,9 +300,12 @@ clear_with_quad(struct gl_context *ctx,
cso_set_fragment_shader_handle(st->cso_context, st->clear.fs);
cso_set_vertex_shader_handle(st->cso_context, st->clear.vs);
 
-   /* draw quad matching scissor rect (XXX verify coord round-off) */
-   draw_quad(st, x0, y0, x1, y1,
- (GLfloat) ctx->Depth.Clear, ctx->Color.ClearColor);
+   st_translate_color(ctx->Color.ClearColor,
+  ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
+  clearColor);
+
+   /* draw quad matching scissor rect */
+   draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, clearColor);
 
/* Restore pipe state */
cso_restore_blend(st->cso_context);
@@ -541,12 +546,19 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
* required from the visual. Hence fix this up to avoid potential
* read-modify-write in the driver.
*/
+  float clearColor[4];
+
   if ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) &&
   ((clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) != 
PIPE_CLEAR_DEPTHSTENCIL) &&
   (depthRb == stencilRb) &&
   (ctx->DrawBuffer->Visual.depthBits == 0 ||
ctx->DrawBuffer->Visual.stencil

Mesa (master): st/mesa: fix the default case in st_format_datatype()

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: c966c6980c2a4a1e50b238f7607a9ce111f6c0b4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c966c6980c2a4a1e50b238f7607a9ce111f6c0b4

Author: Brian Paul 
Date:   Mon Feb 21 16:46:02 2011 -0700

st/mesa: fix the default case in st_format_datatype()

Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.

---

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

diff --git a/src/mesa/state_tracker/st_format.c 
b/src/mesa/state_tracker/st_format.c
index a532e08..3f9c322 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -113,12 +113,9 @@ st_format_datatype(enum pipe_format format)
   return GL_UNSIGNED_SHORT;
}
else {
-  /* compressed format? */
-  assert(0);
+  /* probably a compressed format, unsupported anyway */
+  return GL_NONE;
}
-
-   assert(0);
-   return GL_NONE;
 }
 
 

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


Mesa (master): i915g: add some throttling

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: 55a3c352432d1c7b22e445d041f9cb1990ca28d5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=55a3c352432d1c7b22e445d041f9cb1990ca28d5

Author: Daniel Vetter 
Date:   Mon Feb 21 19:14:02 2011 +0100

i915g: add some throttling

Intel classic drivers switched to this, too, so it must be good.

Signed-off-by: Daniel Vetter 

---

 src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c 
b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index dec19d4..afeab5e 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -4,6 +4,7 @@
 
 #include "i915_drm.h"
 #include "i915/i915_debug.h"
+#include 
 
 #define BATCH_RESERVED 16
 
@@ -132,6 +133,12 @@ i915_drm_batchbuffer_reloc(struct i915_winsys_batchbuffer 
*ibatch,
return ret;
 }
 
+static void 
+i915_drm_throttle(struct i915_drm_winsys *idws)
+{
+   drmIoctl(idws->fd, DRM_IOCTL_I915_GEM_THROTTLE, NULL);
+}
+
 static void
 i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer *ibatch,
 struct pipe_fence_handle **fence)
@@ -155,6 +162,8 @@ i915_drm_batchbuffer_flush(struct i915_winsys_batchbuffer 
*ibatch,
if (ret == 0 && i915_drm_winsys(ibatch->iws)->send_cmd)
   ret = drm_intel_bo_exec(batch->bo, used, NULL, 0, 0);
 
+   i915_drm_throttle(i915_drm_winsys(ibatch->iws));
+
if (ret != 0 || i915_drm_winsys(ibatch->iws)->dump_cmd) {
   i915_dump_batchbuffer(ibatch);
   assert(ret == 0);

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


Mesa (master): i915g: s/bool/boolean/ style-fixup in winsys

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: 1e966636d06e92f562a7dbcd69aa88c4c9283c41
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e966636d06e92f562a7dbcd69aa88c4c9283c41

Author: Daniel Vetter 
Date:   Mon Feb 21 18:25:20 2011 +0100

i915g: s/bool/boolean/ style-fixup in winsys

Signed-off-by: Daniel Vetter 

---

 src/gallium/drivers/i915/i915_winsys.h |3 ++-
 src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c |2 +-
 src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c   |2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_winsys.h 
b/src/gallium/drivers/i915/i915_winsys.h
index 24ea416..e915a88 100644
--- a/src/gallium/drivers/i915/i915_winsys.h
+++ b/src/gallium/drivers/i915/i915_winsys.h
@@ -103,11 +103,12 @@ struct i915_winsys {
 * @usage how is the hardware going to use the buffer.
 * @offset add this to the reloc buffers address
 * @target buffer where to write the address, null for batchbuffer.
+* @fenced relocation needs a fence.
 */
int (*batchbuffer_reloc)(struct i915_winsys_batchbuffer *batch,
 struct i915_winsys_buffer *reloc,
 enum i915_winsys_buffer_usage usage,
-unsigned offset, bool fenced);
+unsigned offset, boolean fenced);
 
/**
 * Flush a bufferbatch.
diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c 
b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index 5894c13..dec19d4 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -74,7 +74,7 @@ static int
 i915_drm_batchbuffer_reloc(struct i915_winsys_batchbuffer *ibatch,
 struct i915_winsys_buffer *buffer,
 enum i915_winsys_buffer_usage usage,
-unsigned pre_add, bool fenced)
+unsigned pre_add, boolean fenced)
 {
struct i915_drm_batchbuffer *batch = i915_drm_batchbuffer(ibatch);
unsigned write_domain = 0;
diff --git a/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c 
b/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c
index 6ffba44..dcb0e54 100644
--- a/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c
+++ b/src/gallium/winsys/i915/sw/i915_sw_batchbuffer.c
@@ -61,7 +61,7 @@ static int
 i915_sw_batchbuffer_reloc(struct i915_winsys_batchbuffer *ibatch,
   struct i915_winsys_buffer *buffer,
   enum i915_winsys_buffer_usage usage,
-  unsigned pre_add, bool fenced)
+  unsigned pre_add, boolean fenced)
 {
struct i915_sw_batchbuffer *batch = i915_sw_batchbuffer(ibatch);
int ret = 0;

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


Mesa (master): i915g: Fix warning

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: 593ba7b05b4052415fe99c2793da5864117d955b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=593ba7b05b4052415fe99c2793da5864117d955b

Author: Jakob Bornecrantz 
Date:   Mon Feb 21 22:00:02 2011 +

i915g: Fix warning

---

 src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c 
b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index 4cfc4a9..5894c13 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -34,7 +34,6 @@ static void
 i915_drm_batchbuffer_reset(struct i915_drm_batchbuffer *batch)
 {
struct i915_drm_winsys *idws = i915_drm_winsys(batch->base.iws);
-   int ret;
 
if (batch->bo)
   drm_intel_bo_unreference(batch->bo);

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


Mesa (master): i915g: Add option to lie about caps

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: 43e6fe5549edb7e837480f28b1262357568d54ea
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=43e6fe5549edb7e837480f28b1262357568d54ea

Author: Jakob Bornecrantz 
Date:   Sun Feb 20 13:41:18 2011 +0100

i915g: Add option to lie about caps

---

 src/gallium/drivers/i915/i915_debug.c  |2 ++
 src/gallium/drivers/i915/i915_screen.c |7 ++-
 src/gallium/drivers/i915/i915_screen.h |1 +
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_debug.c 
b/src/gallium/drivers/i915/i915_debug.c
index d11da83..e0ea025 100644
--- a/src/gallium/drivers/i915/i915_debug.c
+++ b/src/gallium/drivers/i915/i915_debug.c
@@ -50,11 +50,13 @@ boolean i915_tiling = TRUE;
 
 DEBUG_GET_ONCE_FLAGS_OPTION(i915_debug, "I915_DEBUG", debug_options, 0);
 DEBUG_GET_ONCE_BOOL_OPTION(i915_no_tiling, "I915_NO_TILING", FALSE);
+DEBUG_GET_ONCE_BOOL_OPTION(i915_lie, "I915_LIE", FALSE);
 
 void i915_debug_init(struct i915_screen *is)
 {
i915_debug = debug_get_option_i915_debug();
is->debug.tiling = !debug_get_option_i915_no_tiling();
+   is->debug.lie = debug_get_option_i915_lie();
 }
 
 
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index 2260bce..d929eb2 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -100,6 +100,8 @@ i915_get_name(struct pipe_screen *screen)
 static int
 i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
 {
+   struct i915_screen *is = i915_screen(screen);
+
switch (cap) {
/* Supported features (boolean caps). */
case PIPE_CAP_ANISOTROPIC_FILTER:
@@ -123,7 +125,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
case PIPE_CAP_INDEP_BLEND_ENABLE:
case PIPE_CAP_INDEP_BLEND_FUNC:
case PIPE_CAP_INSTANCED_DRAWING: /* draw module? */
-   case PIPE_CAP_OCCLUSION_QUERY:
case PIPE_CAP_POINT_SPRITE:
case PIPE_CAP_SHADER_STENCIL_EXPORT:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
@@ -131,6 +132,10 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
case PIPE_CAP_TIMER_QUERY:
   return 0;
 
+   /* Features we can lie about (boolean caps). */
+   case PIPE_CAP_OCCLUSION_QUERY:
+  return is->debug.lie ? 1 : 0;
+
/* Texturing. */
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
diff --git a/src/gallium/drivers/i915/i915_screen.h 
b/src/gallium/drivers/i915/i915_screen.h
index e76e33a..60f0e29 100644
--- a/src/gallium/drivers/i915/i915_screen.h
+++ b/src/gallium/drivers/i915/i915_screen.h
@@ -48,6 +48,7 @@ struct i915_screen
 
struct {
   boolean tiling;
+  boolean lie;
} debug;
 };
 

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


Mesa (master): i915g: Move debug fields to screen

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: 27b49e91c982638497f7a92f7d611c29dd9cad18
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=27b49e91c982638497f7a92f7d611c29dd9cad18

Author: Jakob Bornecrantz 
Date:   Sun Feb 20 12:52:55 2011 +0100

i915g: Move debug fields to screen

---

 src/gallium/drivers/i915/i915_debug.c|4 ++--
 src/gallium/drivers/i915/i915_debug.h|1 -
 src/gallium/drivers/i915/i915_resource_texture.c |2 +-
 src/gallium/drivers/i915/i915_screen.h   |4 
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_debug.c 
b/src/gallium/drivers/i915/i915_debug.c
index 8dbd36c..d11da83 100644
--- a/src/gallium/drivers/i915/i915_debug.c
+++ b/src/gallium/drivers/i915/i915_debug.c
@@ -51,10 +51,10 @@ boolean i915_tiling = TRUE;
 DEBUG_GET_ONCE_FLAGS_OPTION(i915_debug, "I915_DEBUG", debug_options, 0);
 DEBUG_GET_ONCE_BOOL_OPTION(i915_no_tiling, "I915_NO_TILING", FALSE);
 
-void i915_debug_init(struct i915_screen *screen)
+void i915_debug_init(struct i915_screen *is)
 {
i915_debug = debug_get_option_i915_debug();
-   i915_tiling = !debug_get_option_i915_no_tiling();
+   is->debug.tiling = !debug_get_option_i915_no_tiling();
 }
 
 
diff --git a/src/gallium/drivers/i915/i915_debug.h 
b/src/gallium/drivers/i915/i915_debug.h
index 11af766..fa60799 100644
--- a/src/gallium/drivers/i915/i915_debug.h
+++ b/src/gallium/drivers/i915/i915_debug.h
@@ -46,7 +46,6 @@ struct i915_winsys_batchbuffer;
 #define DBG_CONSTANTS 0x20
 
 extern unsigned i915_debug;
-extern boolean i915_tiling;
 
 #ifdef DEBUG
 static INLINE boolean
diff --git a/src/gallium/drivers/i915/i915_resource_texture.c 
b/src/gallium/drivers/i915/i915_resource_texture.c
index 12790a3..aad5235 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -174,7 +174,7 @@ i915_texture_set_image_offset(struct i915_texture *tex,
 static enum i915_winsys_buffer_tile
 i915_texture_tiling(struct i915_screen *is, struct i915_texture *tex)
 {
-   if (!i915_tiling)
+   if (!is->debug.tiling)
   return I915_TILE_NONE;
 
if (tex->b.b.target == PIPE_TEXTURE_1D)
diff --git a/src/gallium/drivers/i915/i915_screen.h 
b/src/gallium/drivers/i915/i915_screen.h
index bb4d255..e76e33a 100644
--- a/src/gallium/drivers/i915/i915_screen.h
+++ b/src/gallium/drivers/i915/i915_screen.h
@@ -45,6 +45,10 @@ struct i915_screen
struct i915_winsys *iws;
 
boolean is_i945;
+
+   struct {
+  boolean tiling;
+   } debug;
 };
 
 

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


Mesa (master): i915g: Rework texture tiling a bit

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: 3c74ecf687a7b23d7fcb5436722a3f4892034e0a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c74ecf687a7b23d7fcb5436722a3f4892034e0a

Author: Jakob Bornecrantz 
Date:   Sun Feb 20 12:52:11 2011 +0100

i915g: Rework texture tiling a bit

---

 src/gallium/drivers/i915/i915_resource_texture.c |   22 --
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_resource_texture.c 
b/src/gallium/drivers/i915/i915_resource_texture.c
index e793d12..12790a3 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -172,15 +172,15 @@ i915_texture_set_image_offset(struct i915_texture *tex,
 }
 
 static enum i915_winsys_buffer_tile
-i915_texture_tiling(struct pipe_resource *pt)
+i915_texture_tiling(struct i915_screen *is, struct i915_texture *tex)
 {
if (!i915_tiling)
   return I915_TILE_NONE;
 
-   if (pt->target == PIPE_TEXTURE_1D)
+   if (tex->b.b.target == PIPE_TEXTURE_1D)
   return I915_TILE_NONE;
 
-   if (util_format_is_s3tc(pt->format))
+   if (util_format_is_s3tc(tex->b.b.format))
   /* XXX X-tiling might make sense */
   return I915_TILE_NONE;
 
@@ -401,11 +401,7 @@ i915_texture_layout_3d(struct i915_texture *tex)
 static boolean
 i915_texture_layout(struct i915_texture * tex)
 {
-   struct pipe_resource *pt = &tex->b.b;
-
-   tex->tiling = i915_texture_tiling(pt);
-
-   switch (pt->target) {
+   switch (tex->b.b.target) {
case PIPE_TEXTURE_1D:
case PIPE_TEXTURE_2D:
case PIPE_TEXTURE_RECT:
@@ -649,11 +645,7 @@ i945_texture_layout_cube(struct i915_texture *tex)
 static boolean
 i945_texture_layout(struct i915_texture * tex)
 {
-   struct pipe_resource *pt = &tex->b.b;
-
-   tex->tiling = i915_texture_tiling(pt);
-
-   switch (pt->target) {
+   switch (tex->b.b.target) {
case PIPE_TEXTURE_1D:
case PIPE_TEXTURE_2D:
case PIPE_TEXTURE_RECT:
@@ -664,7 +656,7 @@ i945_texture_layout(struct i915_texture * tex)
   i945_texture_layout_3d(tex);
   break;
case PIPE_TEXTURE_CUBE:
-  if (!util_format_is_s3tc(pt->format))
+  if (!util_format_is_s3tc(tex->b.b.format))
  i9x5_texture_layout_cube(tex);
   else
  i945_texture_layout_cube(tex);
@@ -818,6 +810,8 @@ i915_texture_create(struct pipe_screen *screen,
pipe_reference_init(&tex->b.b.reference, 1);
tex->b.b.screen = screen;
 
+   tex->tiling = i915_texture_tiling(is, tex);
+
if (is->is_i945) {
   if (!i945_texture_layout(tex))
  goto fail;

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


Mesa (master): i915g: Use debug get once options

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: fe6800a1bbd2f22fc3b3921765491d9ba179c4ff
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fe6800a1bbd2f22fc3b3921765491d9ba179c4ff

Author: Jakob Bornecrantz 
Date:   Sun Feb 20 11:41:32 2011 +0100

i915g: Use debug get once options

---

 src/gallium/drivers/i915/i915_context.c |5 -
 src/gallium/drivers/i915/i915_debug.c   |7 +--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_context.c 
b/src/gallium/drivers/i915/i915_context.c
index 648d009..78a3234 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -39,6 +39,9 @@
 #include "pipe/p_screen.h"
 
 
+DEBUG_GET_ONCE_BOOL_OPTION(i915_no_vbuf, "I915_NO_VBUF", FALSE);
+
+
 /*
  * Draw functions
  */
@@ -144,7 +147,7 @@ i915_create_context(struct pipe_screen *screen, void *priv)
 */
i915->draw = draw_create(&i915->base);
assert(i915->draw);
-   if (!debug_get_bool_option("I915_NO_VBUF", FALSE)) {
+   if (!debug_get_option_i915_no_vbuf()) {
   draw_set_rasterize_stage(i915->draw, i915_draw_vbuf_stage(i915));
} else {
   draw_set_rasterize_stage(i915->draw, i915_draw_render_stage(i915));
diff --git a/src/gallium/drivers/i915/i915_debug.c 
b/src/gallium/drivers/i915/i915_debug.c
index 845e92c..8dbd36c 100644
--- a/src/gallium/drivers/i915/i915_debug.c
+++ b/src/gallium/drivers/i915/i915_debug.c
@@ -48,10 +48,13 @@ static const struct debug_named_value debug_options[] = {
 unsigned i915_debug = 0;
 boolean i915_tiling = TRUE;
 
+DEBUG_GET_ONCE_FLAGS_OPTION(i915_debug, "I915_DEBUG", debug_options, 0);
+DEBUG_GET_ONCE_BOOL_OPTION(i915_no_tiling, "I915_NO_TILING", FALSE);
+
 void i915_debug_init(struct i915_screen *screen)
 {
-   i915_debug = debug_get_flags_option("I915_DEBUG", debug_options, 0);
-   i915_tiling = !debug_get_bool_option("I915_NO_TILING", FALSE);
+   i915_debug = debug_get_option_i915_debug();
+   i915_tiling = !debug_get_option_i915_no_tiling();
 }
 
 

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


Mesa (master): i915g: Anisotropic filtering works

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: e7e1fd057e8cc78e7039637d045ac922bb82b8d8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7e1fd057e8cc78e7039637d045ac922bb82b8d8

Author: Jakob Bornecrantz 
Date:   Mon Feb 21 21:27:05 2011 +

i915g: Anisotropic filtering works

---

 src/gallium/drivers/i915/i915_screen.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index 232262a..2260bce 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -102,6 +102,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
 {
switch (cap) {
/* Supported features (boolean caps). */
+   case PIPE_CAP_ANISOTROPIC_FILTER:
case PIPE_CAP_NPOT_TEXTURES:
case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */
case PIPE_CAP_TEXTURE_SHADOW_MAP:
@@ -115,7 +116,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
   return 0;
 
/* Unsupported features (boolean caps). */
-   case PIPE_CAP_ANISOTROPIC_FILTER:
case PIPE_CAP_ARRAY_TEXTURES:
case PIPE_CAP_DEPTH_CLAMP:
case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE: /* disable for now */

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


Mesa (master): i915g: TODO about point sprites

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: a64176657602e9acc1b6c9a49ab26586f3a5c254
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a64176657602e9acc1b6c9a49ab26586f3a5c254

Author: Jakob Bornecrantz 
Date:   Sun Feb 20 14:00:03 2011 +0100

i915g: TODO about point sprites

---

 src/gallium/drivers/i915/TODO |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/i915/TODO b/src/gallium/drivers/i915/TODO
index 0becf31..eda5838 100644
--- a/src/gallium/drivers/i915/TODO
+++ b/src/gallium/drivers/i915/TODO
@@ -3,6 +3,9 @@ Random list of problems with i915g:
 - Check if PIPE_CAP_BLEND_EQUATION_SEPARATE and PIPE_CAP_TEXTURE_MIRROR_REPEAT
   work, the code is there. If not fix it! A simple task, good for beginners.
 
+- Add support for PIPE_CAP_POINT_SPRITE either via the draw module or directly
+  via the hardware, look at the classic driver, more advanced.
+
 - Dies with BadDrawable on GLXFBconfig changes/destruction. Makes piglit 
totally
   unusable :( Upgrading xserver helped here, it doesn't crash anymore. Still
   broken, it doesn't update the viewport/get new buffers.

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


Mesa (master): i915g: TODO about untested code hidden behind caps

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: e7cdcefbee6c8bffdc421f38d97578180e7991b5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7cdcefbee6c8bffdc421f38d97578180e7991b5

Author: Jakob Bornecrantz 
Date:   Sun Feb 20 13:58:11 2011 +0100

i915g: TODO about untested code hidden behind caps

Should be fairly easy to test and fix since you can look at
the code in the classic driver.

---

 src/gallium/drivers/i915/TODO  |3 +++
 src/gallium/drivers/i915/i915_screen.c |8 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/i915/TODO b/src/gallium/drivers/i915/TODO
index 94c428b..0becf31 100644
--- a/src/gallium/drivers/i915/TODO
+++ b/src/gallium/drivers/i915/TODO
@@ -1,5 +1,8 @@
 Random list of problems with i915g:
 
+- Check if PIPE_CAP_BLEND_EQUATION_SEPARATE and PIPE_CAP_TEXTURE_MIRROR_REPEAT
+  work, the code is there. If not fix it! A simple task, good for beginners.
+
 - Dies with BadDrawable on GLXFBconfig changes/destruction. Makes piglit 
totally
   unusable :( Upgrading xserver helped here, it doesn't crash anymore. Still
   broken, it doesn't update the viewport/get new buffers.
diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index 31a8134..232262a 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -108,10 +108,15 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
case PIPE_CAP_TWO_SIDED_STENCIL:
   return 1;
 
+   /* Features that should be supported (boolean caps). */
+   /* XXX: Just test the code */
+   case PIPE_CAP_BLEND_EQUATION_SEPARATE:
+   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
+  return 0;
+
/* Unsupported features (boolean caps). */
case PIPE_CAP_ANISOTROPIC_FILTER:
case PIPE_CAP_ARRAY_TEXTURES:
-   case PIPE_CAP_BLEND_EQUATION_SEPARATE:
case PIPE_CAP_DEPTH_CLAMP:
case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE: /* disable for now */
case PIPE_CAP_GLSL:
@@ -122,7 +127,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap 
cap)
case PIPE_CAP_POINT_SPRITE:
case PIPE_CAP_SHADER_STENCIL_EXPORT:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
-   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
case PIPE_CAP_TEXTURE_SWIZZLE:
case PIPE_CAP_TIMER_QUERY:
   return 0;

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


Mesa (master): i915g: Reorg caps

2011-02-21 Thread Jakob Bornecrantz
Module: Mesa
Branch: master
Commit: e3c9bf1a670dd6924537d2e04d522ef899ee5b57
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3c9bf1a670dd6924537d2e04d522ef899ee5b57

Author: Jakob Bornecrantz 
Date:   Sun Feb 20 11:45:48 2011 +0100

i915g: Reorg caps

---

 src/gallium/drivers/i915/i915_screen.c |   70 +++-
 1 files changed, 42 insertions(+), 28 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_screen.c 
b/src/gallium/drivers/i915/i915_screen.c
index 5055c15..31a8134 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -98,59 +98,72 @@ i915_get_name(struct pipe_screen *screen)
 }
 
 static int
-i915_get_param(struct pipe_screen *screen, enum pipe_cap param)
+i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
 {
-   switch (param) {
-   case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
-  return 8;
-   case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
-  return 0;
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-  return 8;
+   switch (cap) {
+   /* Supported features (boolean caps). */
case PIPE_CAP_NPOT_TEXTURES:
-  return 1;
+   case PIPE_CAP_PRIMITIVE_RESTART: /* draw module */
+   case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_TWO_SIDED_STENCIL:
   return 1;
-   case PIPE_CAP_GLSL:
-  return 0;
+
+   /* Unsupported features (boolean caps). */
case PIPE_CAP_ANISOTROPIC_FILTER:
-  return 0;
-   case PIPE_CAP_POINT_SPRITE:
-  return 0;
-   case PIPE_CAP_MAX_RENDER_TARGETS:
-  return 1;
+   case PIPE_CAP_ARRAY_TEXTURES:
+   case PIPE_CAP_BLEND_EQUATION_SEPARATE:
+   case PIPE_CAP_DEPTH_CLAMP:
+   case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE: /* disable for now */
+   case PIPE_CAP_GLSL:
+   case PIPE_CAP_INDEP_BLEND_ENABLE:
+   case PIPE_CAP_INDEP_BLEND_FUNC:
+   case PIPE_CAP_INSTANCED_DRAWING: /* draw module? */
case PIPE_CAP_OCCLUSION_QUERY:
-  return 0;
+   case PIPE_CAP_POINT_SPRITE:
+   case PIPE_CAP_SHADER_STENCIL_EXPORT:
+   case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
+   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
+   case PIPE_CAP_TEXTURE_SWIZZLE:
case PIPE_CAP_TIMER_QUERY:
   return 0;
-   case PIPE_CAP_TEXTURE_SHADOW_MAP:
-  return 1;
+
+   /* 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:
   return I915_MAX_TEXTURE_3D_LEVELS;
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
   return I915_MAX_TEXTURE_2D_LEVELS;
+
+   /* Render targets. */
+   case PIPE_CAP_MAX_RENDER_TARGETS:
+  return 1;
+
+   /* Fragment coordinate conventions. */
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
   return 1;
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
   return 0;
-   case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
-  /* disable for now */
-  return 0;
+
default:
+  debug_printf("%s: Unkown cap %u.\n", __FUNCTION__, cap);
   return 0;
}
 }
 
 static int
-i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum 
pipe_shader_cap param)
+i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum 
pipe_shader_cap cap)
 {
switch(shader) {
case PIPE_SHADER_VERTEX:
-  return draw_get_shader_param(shader, param);
+  return draw_get_shader_param(shader, cap);
case PIPE_SHADER_FRAGMENT:
   break;
default:
@@ -158,7 +171,7 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned 
shader, enum pipe_sha
}
 
/* XXX: these are just shader model 2.0 values, fix this! */
-   switch(param) {
+   switch(cap) {
   case PIPE_SHADER_CAP_MAX_INSTRUCTIONS:
  return 96;
   case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS:
@@ -191,15 +204,15 @@ i915_get_shader_param(struct pipe_screen *screen, 
unsigned shader, enum pipe_sha
   case PIPE_SHADER_CAP_SUBROUTINES:
  return 0;
   default:
- assert(0);
+ debug_printf("%s: Unkown cap %u.\n", __FUNCTION__, cap);
  return 0;
}
 }
 
 static float
-i915_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
+i915_get_paramf(struct pipe_screen *screen, enum pipe_cap cap)
 {
-   switch (param) {
+   switch(cap) {
case PIPE_CAP_MAX_LINE_WIDTH:
   /* fall-through */
case PIPE_CAP_MAX_LINE_WIDTH_AA:
@@ -217,6 +230,7 @@ i915_get_paramf(struct pipe_screen *screen, enum pipe_cap 
param)
   return 16.0;
 
default:
+  debug_printf("%s: Unkown cap %u.\n", __FUNCTION__, cap);
   return 0;
}
 }

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


Mesa (7.9): docs: Update 7.9.2 release notes

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.9
Commit: 246716c8f647d53f41cae4422f8c5f115dd18e09
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=246716c8f647d53f41cae4422f8c5f115dd18e09

Author: Ian Romanick 
Date:   Mon Feb 21 13:58:05 2011 -0800

docs: Update 7.9.2 release notes

Add recent cherry picks

---

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

diff --git a/docs/relnotes-7.9.2.html b/docs/relnotes-7.9.2.html
index 89b04d3..845d933 100644
--- a/docs/relnotes-7.9.2.html
+++ b/docs/relnotes-7.9.2.html
@@ -50,12 +50,18 @@ with in, out, attribute, and 
varying.
 
 https://bugs.freedesktop.org/show_bug.cgi?id=29164";>Bug 29164 
- [GLSL 1.20] invariant variable shouldn't be used before declaration
 
+https://bugs.freedesktop.org/show_bug.cgi?id=29823";>Bug 29823 
- GetUniform[if]v busted
+
 https://bugs.freedesktop.org/show_bug.cgi?id=30156";>Bug 30156 
- [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage
 
 https://bugs.freedesktop.org/show_bug.cgi?id=31923";>Bug 31923 
- [GLSL 1.20] allowing inconsistent centroid declaration between two vertex 
shaders
 
 https://bugs.freedesktop.org/show_bug.cgi?id=31925";>Bug 31925 
- [GLSL 1.20] "#pragma STDGL invariant(all)" fail
 
+https://bugs.freedesktop.org/show_bug.cgi?id=32214";>Bug 32214 
- [gles2]no link error happens when missing vertex shader or frag shader
+
+https://bugs.freedesktop.org/show_bug.cgi?id=32375";>Bug 32375 
- [gl gles2] Not able to get the attribute by function glGetVertexAttribfv
+
 https://bugs.freedesktop.org/show_bug.cgi?id=32695";>Bug 32695 
- [glsl] SIGSEGV glcpp/glcpp-parse.y:833
 
 https://bugs.freedesktop.org/show_bug.cgi?id=32831";>Bug 32831 
- [glsl] division by zero crashes GLSL compiler
@@ -70,6 +76,8 @@ with in, out, attribute, and 
varying.
 
 https://bugs.freedesktop.org/show_bug.cgi?id=33316";>Bug 33316 
- uniform array will be allocate one line more and initialize it when it was 
freed will abort
 
+https://bugs.freedesktop.org/show_bug.cgi?id=34114";>Bug 34114 
- Sun Studio build fails due to standard library functions not being in global 
namespace
+
 
 
 

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


Mesa (7.9): mesa: Fix error checks in GetVertexAttrib functions

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.9
Commit: 8159bef77fadab7f45fc4551296c2f072e1db3f9
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8159bef77fadab7f45fc4551296c2f072e1db3f9

Author: Ian Romanick 
Date:   Thu Feb  3 17:56:44 2011 -0800

mesa: Fix error checks in GetVertexAttrib functions

Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.
(cherry picked from commit 5c3f1cdbbeb4d787bad7729ccd3f10aa78d113ac)

---

 src/mesa/main/varray.c |   68 ++-
 1 files changed, 32 insertions(+), 36 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index d19de7f..fc7ee65 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -783,7 +783,7 @@ get_vertex_array_attrib(GLcontext *ctx, GLuint index, 
GLenum pname,
 {
const struct gl_client_array *array;
 
-   if (index >= MAX_VERTEX_GENERIC_ATTRIBS) {
+   if (index >= ctx->Const.VertexProgram.MaxAttribs) {
   _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", caller, index);
   return 0;
}
@@ -812,6 +812,25 @@ get_vertex_array_attrib(GLcontext *ctx, GLuint index, 
GLenum pname,
 }
 
 
+static const GLfloat *
+get_current_attrib(GLcontext *ctx, GLuint index, const char *function)
+{
+   if (index == 0) {
+  if (ctx->API != API_OPENGLES2) {
+_mesa_error(ctx, GL_INVALID_OPERATION, "%s(index==0)", function);
+return NULL;
+  }
+   }
+   else if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+  _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(index>=GL_MAX_VERTEX_ATTRIBS)", function);
+  return NULL;
+   }
+
+   FLUSH_CURRENT(ctx, 0);
+   return ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
+}
+
 void GLAPIENTRY
 _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
 {
@@ -819,13 +838,8 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, 
GLfloat *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribfv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v = get_current_attrib(ctx, index, "glGetVertexAttribfv");
+  if (v != NULL) {
  COPY_4V(params, v);
   }
}
@@ -843,13 +857,8 @@ _mesa_GetVertexAttribdvARB(GLuint index, GLenum pname, 
GLdouble *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribdv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v = get_current_attrib(ctx, index, "glGetVertexAttribdv");
+  if (v != NULL) {
  params[0] = (GLdouble) v[0];
  params[1] = (GLdouble) v[1];
  params[2] = (GLdouble) v[2];
@@ -870,13 +879,8 @@ _mesa_GetVertexAttribivARB(GLuint index, GLenum pname, 
GLint *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribiv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v = get_current_attrib(ctx, index, "glGetVertexAttribiv");
+  if (v != NULL) {
  /* XXX should floats in[0,1] be scaled to full int range? */
  params[0] = (GLint) v[0];
  params[1] = (GLint) v[1];
@@ -899,13 +903,9 @@ _mesa_GetVertexAttribIiv(GLuint index, GLenum pname, GLint 
*params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribIiv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v =
+get_current_attrib(ctx, index, "glGetVertexAttribIiv");
+  if (v != NULL) {
  /* XXX we don't have true integer-valued vertex attribs yet */
  params[0] = (GLint) v[0];
  params[1] = (GLint) v[1];
@@ -928,13 +928,9 @@ _mesa_GetVertexAttribIuiv(GLuint index, GLenum pname, 
GLuint *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribIuiv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH

Mesa (7.9): linker: Generate link errors when ES shaders are missing stages

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.9
Commit: d8392a2ca8a20db0e010af836a526ae652a47e85
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8392a2ca8a20db0e010af836a526ae652a47e85

Author: Ian Romanick 
Date:   Thu Feb  3 17:10:14 2011 -0800

linker: Generate link errors when ES shaders are missing stages

ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
(cherry picked from commit ce9171f9d8e0e2c2422fdddb198f8d548381b7ea)

---

 src/glsl/linker.cpp |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 5eb4c6d..5f3b062 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1622,6 +1622,20 @@ link_shaders(GLcontext *ctx, struct gl_shader_program 
*prog)
   demote_shader_inputs_and_outputs(sh, ir_var_in);
}
 
+   /* OpenGL ES requires that a vertex shader and a fragment shader both be
+* present in a linked program.  By checking for use of shading language
+* version 1.00, we also catch the GL_ARB_ES2_compatibility case.
+*/
+   if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
+  if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
+linker_error_printf(prog, "program lacks a vertex shader\n");
+prog->LinkStatus = false;
+  } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
+linker_error_printf(prog, "program lacks a fragment shader\n");
+prog->LinkStatus = false;
+  }
+   }
+
/* FINISHME: Assign fragment shader output locations. */
 
 done:

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


Mesa (7.9): mesa: glGetUniform only returns a single element of an array

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.9
Commit: ac270e43e68338834b44f3391ac4342cd75c2631
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac270e43e68338834b44f3391ac4342cd75c2631

Author: Ian Romanick 
Date:   Thu Jan 27 12:24:27 2011 -0800

mesa: glGetUniform only returns a single element of an array

Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.

(cherry picked from commit 20d278a7ff0ce66e5c4ac437e1fbe52c31a1ecb3)

---

 src/mesa/main/uniforms.c |   51 ++---
 1 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 5224b03..40bb44c 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -215,6 +215,36 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, 
GLuint index,
 }
 
 
+static unsigned
+get_vector_elements(GLenum type)
+{
+   switch (type) {
+   case GL_FLOAT:
+   case GL_INT:
+   case GL_BOOL:
+   case GL_UNSIGNED_INT:
+   default: /* Catch all the various sampler types. */
+  return 1;
+
+   case GL_FLOAT_VEC2:
+   case GL_INT_VEC2:
+   case GL_BOOL_VEC2:
+   case GL_UNSIGNED_INT_VEC2:
+  return 2;
+
+   case GL_FLOAT_VEC3:
+   case GL_INT_VEC3:
+   case GL_BOOL_VEC3:
+   case GL_UNSIGNED_INT_VEC3:
+  return 3;
+
+   case GL_FLOAT_VEC4:
+   case GL_INT_VEC4:
+   case GL_BOOL_VEC4:
+   case GL_UNSIGNED_INT_VEC4:
+  return 4;
+   }
+}
 
 static void
 get_matrix_dims(GLenum type, GLint *rows, GLint *cols)
@@ -273,17 +303,8 @@ get_uniform_rows_cols(const struct gl_program_parameter *p,
get_matrix_dims(p->DataType, rows, cols);
if (*rows == 0 && *cols == 0) {
   /* not a matrix type, probably a float or vector */
-  if (p->Size <= 4) {
- *rows = 1;
- *cols = p->Size;
-  }
-  else {
- *rows = (p->Size + 3) / 4;
- if (p->Size % 4 == 0)
-*cols = 4;
- else
-*cols = p->Size % 4;
-  }
+  *rows = 1;
+  *cols = get_vector_elements(p->DataType);
}
 }
 
@@ -407,8 +428,10 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint 
location,
 
   k = 0;
   for (i = 0; i < rows; i++) {
+const int base = paramPos + offset + i;
+
  for (j = 0; j < cols; j++ ) {
-params[k++] = prog->Parameters->ParameterValues[paramPos+i][j];
+params[k++] = prog->Parameters->ParameterValues[base][j];
  }
   }
}
@@ -440,8 +463,10 @@ _mesa_get_uniformiv(GLcontext *ctx, GLuint program, GLint 
location,
 
   k = 0;
   for (i = 0; i < rows; i++) {
+const int base = paramPos + offset + i;
+
  for (j = 0; j < cols; j++ ) {
-params[k++] = (GLint) 
prog->Parameters->ParameterValues[paramPos+i][j];
+params[k++] = (GLint) prog->Parameters->ParameterValues[base][j];
  }
   }
}

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


Mesa (7.9): intel: Make renderbuffer tiling choice match texture tiling choice.

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.9
Commit: fc09445c879808c153831341d94d4835cd98ae82
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc09445c879808c153831341d94d4835cd98ae82

Author: Eric Anholt 
Date:   Fri Jan  7 18:18:50 2011 -0800

intel: Make renderbuffer tiling choice match texture tiling choice.

There really shouldn't be any difference between the two for us.
Fixes a bug where Z16 renderbuffers would be untiled on gen6, likely
leading to hangs.
(cherry picked from commit 29c4f95cbcad29d52bf3b6c875840b38b8823e4c)
(cherry picked from commit 4e0d6cf7bad7ef15995693d58348fcb7f47120d3)

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c 
b/src/mesa/drivers/dri/intel/intel_fbo.c
index 41d60e6..23c755a 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -177,10 +177,15 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct 
gl_renderbuffer *rb,
DBG("Allocating %d x %d Intel RBO\n", width, height);
 
tiling = I915_TILING_NONE;
-
-   /* Gen6 requires depth must be tiling */
-   if (intel->gen >= 6 && rb->Format == MESA_FORMAT_S8_Z24)
-   tiling = I915_TILING_Y;
+   if (intel->use_texture_tiling) {
+  GLenum base_format = _mesa_get_format_base_format(rb->Format);
+
+  if (intel->gen >= 4 && (base_format == GL_DEPTH_COMPONENT ||
+ base_format == GL_DEPTH_STENCIL))
+tiling = I915_TILING_Y;
+  else
+tiling = I915_TILING_X;
+   }
 
irb->region = intel_region_alloc(intel->intelScreen, tiling, cpp,
width, height, GL_TRUE);

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


Mesa (7.9): Use C-style system headers in C++ code to avoid issues with std :: namespace

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.9
Commit: 0f3a9643c62174028a74bd7bffdca6d745b2c743
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f3a9643c62174028a74bd7bffdca6d745b2c743

Author: Ian Romanick 
Date:   Mon Feb 21 13:18:05 2011 -0800

Use C-style system headers in C++ code to avoid issues with std:: namespace

Based on commit 497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f from master.

---

 src/glsl/ast_expr.cpp |4 ++--
 src/glsl/ast_type.cpp |2 +-
 src/glsl/glsl_parser_extras.h |2 +-
 src/glsl/glsl_types.cpp   |2 +-
 src/glsl/glsl_types.h |4 ++--
 src/glsl/ir.h |4 ++--
 src/glsl/ir_import_prototypes.cpp |2 +-
 src/glsl/ir_reader.cpp|2 +-
 src/glsl/link_functions.cpp   |6 +++---
 src/glsl/linker.cpp   |8 
 src/glsl/loop_controls.cpp|2 +-
 src/glsl/main.cpp |4 ++--
 src/glsl/s_expression.cpp |6 +++---
 13 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/glsl/ast_expr.cpp b/src/glsl/ast_expr.cpp
index 4e83dec..7e0c7bd 100644
--- a/src/glsl/ast_expr.cpp
+++ b/src/glsl/ast_expr.cpp
@@ -20,8 +20,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include 
-#include 
+#include 
+#include 
 #include "ast.h"
 
 const char *
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 583f24b..d5e6613 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 #include "ast.h"
 extern "C" {
 #include "program/symbol_table.h"
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 8ba9173..af6c6b6 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -31,7 +31,7 @@
 #ifdef __cplusplus
 
 
-#include 
+#include 
 #include "glsl_symbol_table.h"
 
 enum _mesa_glsl_parser_targets {
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 2eaaf28..765e920 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 #include 
 #include "main/core.h" /* for Elements */
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index 878e819..e55b1ff 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -26,8 +26,8 @@
 #ifndef GLSL_TYPES_H
 #define GLSL_TYPES_H
 
-#include 
-#include 
+#include 
+#include 
 
 extern "C" {
 #include "GL/gl.h"
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 19a5d24..3b949e8 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -26,8 +26,8 @@
 #ifndef IR_H
 #define IR_H
 
-#include 
-#include 
+#include 
+#include 
 
 #include "ralloc.h"
 #include "list.h"
diff --git a/src/glsl/ir_import_prototypes.cpp 
b/src/glsl/ir_import_prototypes.cpp
index 272c926..ed8a99a 100644
--- a/src/glsl/ir_import_prototypes.cpp
+++ b/src/glsl/ir_import_prototypes.cpp
@@ -27,7 +27,7 @@
  *
  * \author Ian Romanick
  */
-#include 
+#include 
 #include "ir.h"
 #include "glsl_symbol_table.h"
 
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index 6d5c87c..b37ef87 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 
 #include "ir_reader.h"
 #include "glsl_parser_extras.h"
diff --git a/src/glsl/link_functions.cpp b/src/glsl/link_functions.cpp
index 5bbc921..0305b46 100644
--- a/src/glsl/link_functions.cpp
+++ b/src/glsl/link_functions.cpp
@@ -21,9 +21,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include "main/core.h"
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index f266df5..5eb4c6d 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -63,10 +63,10 @@
  *
  * \author Ian Romanick 
  */
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
 
 #include "main/core.h"
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp
index 9eaa50f..9acbadc 100644
--- a/src/glsl/loop_controls.cpp
+++ b/src/glsl/loop_controls.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 #include "main/compiler.h"
 #include "glsl_types.h"
 #include "loop_analysis.h"
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index 8543e20..ea26886 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -20,8 +20,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include 
-#include 
+#include 
+#include 
 #include 
 
 #include 
diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
index 2ec3c45..c95c4e7 100644
--- a/src/glsl/s_expression.cpp
+++ b/src/glsl/s_expression.cpp
@@ -22,9 +22,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 

Mesa (7.9): glsl: Fix the lowering of variable array indexing to not lose write_masks.

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.9
Commit: 59422a1716374239042d03b033be3b18c0718071
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=59422a1716374239042d03b033be3b18c0718071

Author: Eric Anholt 
Date:   Tue Jan 11 14:50:19 2011 -0800

glsl: Fix the lowering of variable array indexing to not lose write_masks.

Fixes glsl-complex-subscript on 965.
(cherry picked from commit c00bc13564e432c496aa685d7b3ca7c60165be02)

---

 src/glsl/lower_variable_index_to_cond_assign.cpp |   50 --
 1 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/src/glsl/lower_variable_index_to_cond_assign.cpp 
b/src/glsl/lower_variable_index_to_cond_assign.cpp
index 5f30db7..147a6ae 100644
--- a/src/glsl/lower_variable_index_to_cond_assign.cpp
+++ b/src/glsl/lower_variable_index_to_cond_assign.cpp
@@ -42,6 +42,7 @@ struct assignment_generator
ir_instruction* base_ir;
ir_rvalue* array;
bool is_write;
+   unsigned int write_mask;
ir_variable* var;
 
assignment_generator()
@@ -54,14 +55,18 @@ struct assignment_generator
* underlying variable.
*/
   void *mem_ctx = ralloc_parent(base_ir);
-  ir_rvalue *element =
+  ir_dereference *element =
 new(mem_ctx) ir_dereference_array(this->array->clone(mem_ctx, NULL),
   new(mem_ctx) ir_constant(i));
   ir_rvalue *variable = new(mem_ctx) ir_dereference_variable(this->var);
 
-  ir_assignment *assignment = (is_write)
-? new(mem_ctx) ir_assignment(element, variable, condition)
-: new(mem_ctx) ir_assignment(variable, element, condition);
+  ir_assignment *assignment;
+  if (is_write) {
+assignment = new(mem_ctx) ir_assignment(element, variable, condition,
+write_mask);
+  } else {
+assignment = new(mem_ctx) ir_assignment(variable, element, condition);
+  }
 
   list->push_tail(assignment);
}
@@ -262,7 +267,7 @@ public:
}
 
ir_variable *convert_dereference_array(ir_dereference_array *orig_deref,
- ir_rvalue* value)
+ ir_assignment* orig_assign)
{
   assert(is_array_or_matrix(orig_deref->array));
 
@@ -271,16 +276,30 @@ public:
  : orig_deref->array->type->matrix_columns;
 
   void *const mem_ctx = ralloc_parent(base_ir);
-  ir_variable *var =
-new(mem_ctx) ir_variable(orig_deref->type, "dereference_array_value",
- ir_var_temporary);
-  base_ir->insert_before(var);
 
-  if (value) {
+  /* Temporary storage for either the result of the dereference of
+   * the array, or the RHS that's being assigned into the
+   * dereference of the array.
+   */
+  ir_variable *var;
+
+  if (orig_assign) {
+var = new(mem_ctx) ir_variable(orig_assign->rhs->type,
+   "dereference_array_value",
+   ir_var_temporary);
+base_ir->insert_before(var);
+
 ir_dereference *lhs = new(mem_ctx) ir_dereference_variable(var);
-ir_assignment *assign = new(mem_ctx) ir_assignment(lhs, value, NULL);
+ir_assignment *assign = new(mem_ctx) ir_assignment(lhs,
+   orig_assign->rhs,
+   NULL);
 
  base_ir->insert_before(assign);
+  } else {
+var = new(mem_ctx) ir_variable(orig_deref->type,
+   "dereference_array_value",
+   ir_var_temporary);
+base_ir->insert_before(var);
   }
 
   /* Store the index to a temporary to avoid reusing its tree. */
@@ -298,7 +317,12 @@ public:
   ag.array = orig_deref->array;
   ag.base_ir = base_ir;
   ag.var = var;
-  ag.is_write = !!value;
+  if (orig_assign) {
+ag.is_write = true;
+ag.write_mask = orig_assign->write_mask;
+  } else {
+ag.is_write = false;
+  }
 
   switch_generator sg(ag, index, 4, 4);
 
@@ -331,7 +355,7 @@ public:
   ir_dereference_array *orig_deref = ir->lhs->as_dereference_array();
 
   if (needs_lowering(orig_deref)) {
- convert_dereference_array(orig_deref, ir->rhs);
+ convert_dereference_array(orig_deref, ir);
  ir->remove();
  this->progress = true;
   }

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


Mesa (7.10): docs: Update 7.10.1 release notes

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.10
Commit: fef0bf65a75417652b055e270239958e75b3759d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fef0bf65a75417652b055e270239958e75b3759d

Author: Ian Romanick 
Date:   Mon Feb 21 13:35:59 2011 -0800

docs: Update 7.10.1 release notes

Add recent cherry picks

---

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

diff --git a/docs/relnotes-7.10.1.html b/docs/relnotes-7.10.1.html
index 1cd8d85..87cfcd5 100644
--- a/docs/relnotes-7.10.1.html
+++ b/docs/relnotes-7.10.1.html
@@ -48,12 +48,18 @@ with in, out, attribute, and 
varying.
 
 https://bugs.freedesktop.org/show_bug.cgi?id=29164";>Bug 29164 
- [GLSL 1.20] invariant variable shouldn't be used before declaration
 
+https://bugs.freedesktop.org/show_bug.cgi?id=29823";>Bug 29823 
- GetUniform[if]v busted
+
 https://bugs.freedesktop.org/show_bug.cgi?id=30156";>Bug 30156 
- [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage
 
 https://bugs.freedesktop.org/show_bug.cgi?id=31923";>Bug 31923 
- [GLSL 1.20] allowing inconsistent centroid declaration between two vertex 
shaders
 
 https://bugs.freedesktop.org/show_bug.cgi?id=31925";>Bug 31925 
- [GLSL 1.20] "#pragma STDGL invariant(all)" fail
 
+https://bugs.freedesktop.org/show_bug.cgi?id=32214";>Bug 32214 
- [gles2]no link error happens when missing vertex shader or frag shader
+
+https://bugs.freedesktop.org/show_bug.cgi?id=32375";>Bug 32375 
- [gl gles2] Not able to get the attribute by function glGetVertexAttribfv
+
 https://bugs.freedesktop.org/show_bug.cgi?id=32695";>Bug 32695 
- [glsl] SIGSEGV glcpp/glcpp-parse.y:833
 
 https://bugs.freedesktop.org/show_bug.cgi?id=32831";>Bug 32831 
- [glsl] division by zero crashes GLSL compiler
@@ -66,6 +72,14 @@ with in, out, attribute, and 
varying.
 
 https://bugs.freedesktop.org/show_bug.cgi?id=33316";>Bug 33316 
- uniform array will be allocate one line more and initialize it when it was 
freed will abort
 
+https://bugs.freedesktop.org/show_bug.cgi?id=34030";>Bug 34030 
- [bisected] Starcraft 2: some effects are corrupted or too big
+
+https://bugs.freedesktop.org/show_bug.cgi?id=34114";>Bug 34114 
- Sun Studio build fails due to standard library functions not being in global 
namespace
+
+https://bugs.freedesktop.org/show_bug.cgi?id=34179";>Bug 34179 
- Nouveau 3D driver: nv50_pc_emit.c:863 assertion error kills Compiz
+
+https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653";>Ubuntu bug 
691653 - compiz crashes when using alt-tab (the radeon driver kills it) 

+
 
 
 

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


Mesa (7.10): Use C-style system headers in C++ code to avoid issues with std:: namespace

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.10
Commit: 5ad00ef7a367b415f47d95f5274bc749301d870d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5ad00ef7a367b415f47d95f5274bc749301d870d

Author: Ian Romanick 
Date:   Mon Feb 21 13:15:07 2011 -0800

Use C-style system headers in C++ code to avoid issues with std:: namespace

Based on commit 497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f from master.

---

 src/glsl/ast_expr.cpp |4 ++--
 src/glsl/ast_type.cpp |2 +-
 src/glsl/glsl_parser_extras.h |2 +-
 src/glsl/glsl_types.cpp   |2 +-
 src/glsl/glsl_types.h |4 ++--
 src/glsl/ir.h |4 ++--
 src/glsl/ir_import_prototypes.cpp |2 +-
 src/glsl/ir_reader.cpp|2 +-
 src/glsl/link_functions.cpp   |6 +++---
 src/glsl/linker.cpp   |8 
 src/glsl/loop_controls.cpp|2 +-
 src/glsl/main.cpp |4 ++--
 src/glsl/s_expression.cpp |6 +++---
 src/mesa/program/sampler.cpp  |2 +-
 14 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/glsl/ast_expr.cpp b/src/glsl/ast_expr.cpp
index 4e83dec..7e0c7bd 100644
--- a/src/glsl/ast_expr.cpp
+++ b/src/glsl/ast_expr.cpp
@@ -20,8 +20,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include 
-#include 
+#include 
+#include 
 #include "ast.h"
 
 const char *
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 47d4f9f..172b271 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 #include "ast.h"
 extern "C" {
 #include "program/symbol_table.h"
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index bb77678..9422f61 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -31,7 +31,7 @@
 #ifdef __cplusplus
 
 
-#include 
+#include 
 #include "glsl_symbol_table.h"
 
 enum _mesa_glsl_parser_targets {
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index f4d9242..76b4f3e 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 #include 
 #include "main/core.h" /* for Elements */
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index ab6858f..61bf5e0 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -26,8 +26,8 @@
 #ifndef GLSL_TYPES_H
 #define GLSL_TYPES_H
 
-#include 
-#include 
+#include 
+#include 
 
 extern "C" {
 #include "GL/gl.h"
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index c4d2fbf..243723c 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -26,8 +26,8 @@
 #ifndef IR_H
 #define IR_H
 
-#include 
-#include 
+#include 
+#include 
 
 #include "ralloc.h"
 #include "glsl_types.h"
diff --git a/src/glsl/ir_import_prototypes.cpp 
b/src/glsl/ir_import_prototypes.cpp
index be5e0c1..50fe4ed 100644
--- a/src/glsl/ir_import_prototypes.cpp
+++ b/src/glsl/ir_import_prototypes.cpp
@@ -27,7 +27,7 @@
  *
  * \author Ian Romanick
  */
-#include 
+#include 
 #include "ir.h"
 #include "glsl_symbol_table.h"
 
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index e395ee9..0e18881 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 
 #include "ir_reader.h"
 #include "glsl_parser_extras.h"
diff --git a/src/glsl/link_functions.cpp b/src/glsl/link_functions.cpp
index 861fa39..19a2eeb 100644
--- a/src/glsl/link_functions.cpp
+++ b/src/glsl/link_functions.cpp
@@ -21,9 +21,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include "main/core.h"
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 61795d0..09eaa72 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -63,10 +63,10 @@
  *
  * \author Ian Romanick 
  */
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
 
 #include "main/core.h"
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp
index 9eaa50f..9acbadc 100644
--- a/src/glsl/loop_controls.cpp
+++ b/src/glsl/loop_controls.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 #include "main/compiler.h"
 #include "glsl_types.h"
 #include "loop_analysis.h"
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index efb49f0..83a523a 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -20,8 +20,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include 
-#include 
+#include 
+#include 
 #include 
 
 #include 
diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
index 7c45fb8..34e503f 100644
--- a/src/glsl/s_expression.cpp
+++ b/src/glsl/s_expression.cpp
@@ 

Mesa (7.10): mesa: Fix error checks in GetVertexAttrib functions

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.10
Commit: 60675572f7a7841e23d84248cc4d031582e6af36
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=60675572f7a7841e23d84248cc4d031582e6af36

Author: Ian Romanick 
Date:   Thu Feb  3 17:56:44 2011 -0800

mesa: Fix error checks in GetVertexAttrib functions

Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.
(cherry picked from commit 5c3f1cdbbeb4d787bad7729ccd3f10aa78d113ac)

---

 src/mesa/main/varray.c |   68 ++-
 1 files changed, 32 insertions(+), 36 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 32bf95e..3fcd1f4 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -507,7 +507,7 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint 
index, GLenum pname,
 {
const struct gl_client_array *array;
 
-   if (index >= MAX_VERTEX_GENERIC_ATTRIBS) {
+   if (index >= ctx->Const.VertexProgram.MaxAttribs) {
   _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", caller, index);
   return 0;
}
@@ -541,6 +541,25 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint 
index, GLenum pname,
 }
 
 
+static const GLfloat *
+get_current_attrib(struct gl_context *ctx, GLuint index, const char *function)
+{
+   if (index == 0) {
+  if (ctx->API != API_OPENGLES2) {
+_mesa_error(ctx, GL_INVALID_OPERATION, "%s(index==0)", function);
+return NULL;
+  }
+   }
+   else if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+  _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(index>=GL_MAX_VERTEX_ATTRIBS)", function);
+  return NULL;
+   }
+
+   FLUSH_CURRENT(ctx, 0);
+   return ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
+}
+
 void GLAPIENTRY
 _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat *params)
 {
@@ -548,13 +567,8 @@ _mesa_GetVertexAttribfvARB(GLuint index, GLenum pname, 
GLfloat *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribfv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v = get_current_attrib(ctx, index, "glGetVertexAttribfv");
+  if (v != NULL) {
  COPY_4V(params, v);
   }
}
@@ -572,13 +586,8 @@ _mesa_GetVertexAttribdvARB(GLuint index, GLenum pname, 
GLdouble *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribdv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v = get_current_attrib(ctx, index, "glGetVertexAttribdv");
+  if (v != NULL) {
  params[0] = (GLdouble) v[0];
  params[1] = (GLdouble) v[1];
  params[2] = (GLdouble) v[2];
@@ -599,13 +608,8 @@ _mesa_GetVertexAttribivARB(GLuint index, GLenum pname, 
GLint *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribiv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v = get_current_attrib(ctx, index, "glGetVertexAttribiv");
+  if (v != NULL) {
  /* XXX should floats in[0,1] be scaled to full int range? */
  params[0] = (GLint) v[0];
  params[1] = (GLint) v[1];
@@ -628,13 +632,9 @@ _mesa_GetVertexAttribIiv(GLuint index, GLenum pname, GLint 
*params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribIiv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index];
- FLUSH_CURRENT(ctx, 0);
+  const GLfloat *v =
+get_current_attrib(ctx, index, "glGetVertexAttribIiv");
+  if (v != NULL) {
  /* XXX we don't have true integer-valued vertex attribs yet */
  params[0] = (GLint) v[0];
  params[1] = (GLint) v[1];
@@ -657,13 +657,9 @@ _mesa_GetVertexAttribIuiv(GLuint index, GLenum pname, 
GLuint *params)
ASSERT_OUTSIDE_BEGIN_END(ctx);
 
if (pname == GL_CURRENT_VERTEX_ATTRIB_ARB) {
-  if (index == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetVertexAttribIuiv(index==0)");
-  }
-  else {
- const GLfloat *v = ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 

Mesa (7.10): linker: Generate link errors when ES shaders are missing stages

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.10
Commit: 6b7b2af43a5d6784a62b6da3f6db52d1190ce55b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b7b2af43a5d6784a62b6da3f6db52d1190ce55b

Author: Ian Romanick 
Date:   Thu Feb  3 17:10:14 2011 -0800

linker: Generate link errors when ES shaders are missing stages

ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
(cherry picked from commit ce9171f9d8e0e2c2422fdddb198f8d548381b7ea)

---

 src/glsl/linker.cpp |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index e296507..61795d0 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1655,6 +1655,20 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
   demote_shader_inputs_and_outputs(sh, ir_var_in);
}
 
+   /* OpenGL ES requires that a vertex shader and a fragment shader both be
+* present in a linked program.  By checking for use of shading language
+* version 1.00, we also catch the GL_ARB_ES2_compatibility case.
+*/
+   if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
+  if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
+linker_error_printf(prog, "program lacks a vertex shader\n");
+prog->LinkStatus = false;
+  } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
+linker_error_printf(prog, "program lacks a fragment shader\n");
+prog->LinkStatus = false;
+  }
+   }
+
/* FINISHME: Assign fragment shader output locations. */
 
 done:

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


Mesa (7.10): mesa: glGetUniform only returns a single element of an array

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: 7.10
Commit: 9a9bd548b001766bd1480ff2572655bd456909f8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a9bd548b001766bd1480ff2572655bd456909f8

Author: Ian Romanick 
Date:   Thu Jan 27 12:24:27 2011 -0800

mesa: glGetUniform only returns a single element of an array

Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.
(cherry picked from commit 20d278a7ff0ce66e5c4ac437e1fbe52c31a1ecb3)

---

 src/mesa/main/uniforms.c |   55 ++---
 1 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index ea63dd0..2b3dfa4 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -448,6 +448,36 @@ _mesa_get_active_uniform(struct gl_context *ctx, GLuint 
program, GLuint index,
 }
 
 
+static unsigned
+get_vector_elements(GLenum type)
+{
+   switch (type) {
+   case GL_FLOAT:
+   case GL_INT:
+   case GL_BOOL:
+   case GL_UNSIGNED_INT:
+   default: /* Catch all the various sampler types. */
+  return 1;
+
+   case GL_FLOAT_VEC2:
+   case GL_INT_VEC2:
+   case GL_BOOL_VEC2:
+   case GL_UNSIGNED_INT_VEC2:
+  return 2;
+
+   case GL_FLOAT_VEC3:
+   case GL_INT_VEC3:
+   case GL_BOOL_VEC3:
+   case GL_UNSIGNED_INT_VEC3:
+  return 3;
+
+   case GL_FLOAT_VEC4:
+   case GL_INT_VEC4:
+   case GL_BOOL_VEC4:
+   case GL_UNSIGNED_INT_VEC4:
+  return 4;
+   }
+}
 
 static void
 get_matrix_dims(GLenum type, GLint *rows, GLint *cols)
@@ -506,17 +536,8 @@ get_uniform_rows_cols(const struct gl_program_parameter *p,
get_matrix_dims(p->DataType, rows, cols);
if (*rows == 0 && *cols == 0) {
   /* not a matrix type, probably a float or vector */
-  if (p->Size <= 4) {
- *rows = 1;
- *cols = p->Size;
-  }
-  else {
- *rows = (p->Size + 3) / 4;
- if (p->Size % 4 == 0)
-*cols = 4;
- else
-*cols = p->Size % 4;
-  }
+  *rows = 1;
+  *cols = get_vector_elements(p->DataType);
}
 }
 
@@ -640,8 +661,10 @@ _mesa_get_uniformfv(struct gl_context *ctx, GLuint 
program, GLint location,
 
   k = 0;
   for (i = 0; i < rows; i++) {
+const int base = paramPos + offset + i;
+
  for (j = 0; j < cols; j++ ) {
-params[k++] = prog->Parameters->ParameterValues[paramPos+i][j];
+params[k++] = prog->Parameters->ParameterValues[base][j];
  }
   }
}
@@ -673,8 +696,10 @@ _mesa_get_uniformiv(struct gl_context *ctx, GLuint 
program, GLint location,
 
   k = 0;
   for (i = 0; i < rows; i++) {
+const int base = paramPos + offset + i;
+
  for (j = 0; j < cols; j++ ) {
-params[k++] = (GLint) 
prog->Parameters->ParameterValues[paramPos+i][j];
+params[k++] = (GLint) prog->Parameters->ParameterValues[base][j];
  }
   }
}
@@ -707,8 +732,10 @@ _mesa_get_uniformuiv(struct gl_context *ctx, GLuint 
program, GLint location,
 
   k = 0;
   for (i = 0; i < rows; i++) {
+const int base = paramPos + offset + i;
+
  for (j = 0; j < cols; j++ ) {
-params[k++] = (GLuint) 
prog->Parameters->ParameterValues[paramPos+i][j];
+params[k++] = (GLuint) prog->Parameters->ParameterValues[base][j];
  }
   }
}

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


Mesa (master): st/mesa: fix incorrect texture size allocation in st_finalize_texture()

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 7dbafea860dace9bfad29760f8b756122bc9937a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7dbafea860dace9bfad29760f8b756122bc9937a

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

st/mesa: fix incorrect texture size allocation in st_finalize_texture()

If finalizing a non-POW mipmapped texture with an odd-sized base texture
image we were allocating the wrong size of gallium texture (off by one).
Need to be more careful about computing the base texture image size.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=34463

---

 src/mesa/state_tracker/st_cb_texture.c |   21 ++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index 7568b31..a40a79b 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1746,9 +1746,24 @@ st_finalize_texture(struct gl_context *ctx,
 
/* Find gallium format for the Mesa texture */
firstImageFormat = 
st_mesa_format_to_pipe_format(firstImage->base.TexFormat);
-   st_gl_texture_dims_to_pipe_dims(stObj->base.Target, stObj->width0,
-   stObj->height0, stObj->depth0,
-   &ptWidth, &ptHeight, &ptDepth, &ptLayers);
+
+   /* Find size of level=0 Gallium mipmap image, plus number of texture layers 
*/
+   {
+  GLuint width, height, depth;
+  if (!guess_base_level_size(stObj->base.Target,
+ firstImage->base.Width2,
+ firstImage->base.Height2,
+ firstImage->base.Depth2,
+ stObj->base.BaseLevel,
+ &width, &height, &depth)) {
+ width = stObj->width0;
+ height = stObj->height0;
+ depth = stObj->depth0;
+  }
+  /* convert GL dims to Gallium dims */
+  st_gl_texture_dims_to_pipe_dims(stObj->base.Target, width, height, depth,
+  &ptWidth, &ptHeight, &ptDepth, 
&ptLayers);
+   }
 
/* If we already have a gallium texture, check that it matches the texture
 * object's format, target, size, num_levels, etc.

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


Mesa (master): st/mesa: refactor guess_and_alloc_texture() code

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

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

st/mesa: refactor guess_and_alloc_texture() code

---

 src/mesa/state_tracker/st_cb_texture.c |   95 
 1 files changed, 60 insertions(+), 35 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index b758854..7568b31 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -260,6 +260,55 @@ get_texture_dims(GLenum target)
 
 
 /**
+ * Given the size of a mipmap image, try to compute the size of the level=0
+ * mipmap image.
+ *
+ * Note that this isn't always accurate for odd-sized, non-POW textures.
+ * For example, if level=1 and width=40 then the level=0 width may be 80 or 81.
+ *
+ * \return GL_TRUE for success, GL_FALSE for failure
+ */
+static GLboolean
+guess_base_level_size(GLenum target,
+  GLuint width, GLuint height, GLuint depth, GLuint level,
+  GLuint *width0, GLuint *height0, GLuint *depth0)
+{ 
+   const GLuint dims = get_texture_dims(target);
+
+   assert(width >= 1);
+   assert(height >= 1);
+   assert(depth >= 1);
+
+   if (level > 0) {
+  /* Depending on the image's size, we can't always make a guess here */
+  if ((dims >= 1 && width == 1) ||
+  (dims >= 2 && height == 1) ||
+  (dims >= 3 && depth == 1)) {
+ /* we can't determine the image size at level=0 */
+ return GL_FALSE;
+  }
+
+  /* grow the image size until we hit level = 0 */
+  while (level > 0) {
+ if (width > 1)
+width <<= 1;
+ if (height > 1)
+height <<= 1;
+ if (depth > 1)
+depth <<= 1;
+ level--;
+  }
+   }  
+
+   *width0 = width;
+   *height0 = height;
+   *depth0 = depth;
+
+   return GL_TRUE;
+}
+
+
+/**
  * Try to allocate a pipe_resource object for the given st_texture_object.
  *
  * We use the given st_texture_image as a clue to determine the size of the
@@ -272,8 +321,7 @@ guess_and_alloc_texture(struct st_context *st,
struct st_texture_object *stObj,
const struct st_texture_image *stImage)
 {
-   const GLuint dims = get_texture_dims(stObj->base.Target);
-   GLuint level, lastLevel, width, height, depth;
+   GLuint lastLevel, width, height, depth;
GLuint bindings;
GLuint ptWidth, ptHeight, ptDepth, ptLayers;
enum pipe_format fmt;
@@ -282,41 +330,18 @@ guess_and_alloc_texture(struct st_context *st,
 
assert(!stObj->pt);
 
-   level = stImage->level;
-   width = stImage->base.Width2;  /* size w/out border */
-   height = stImage->base.Height2;
-   depth = stImage->base.Depth2;
-
-   assert(width > 0);
-   assert(height > 0);
-   assert(depth > 0);
-
-   /* Depending on the image's size, we can't always make a guess here.
-*/
-   if (level > 0) {
-  if ( (dims >= 1 && width == 1) ||
-   (dims >= 2 && height == 1) ||
-   (dims >= 3 && depth == 1) ) {
- /* we can't determine the image size at level=0 */
- stObj->width0 = stObj->height0 = stObj->depth0 = 0;
- /* this is not an out of memory error */
- return GL_TRUE;
-  }
+   if (!guess_base_level_size(stObj->base.Target,
+  stImage->base.Width2,
+  stImage->base.Height2,
+  stImage->base.Depth2,
+  stImage->level,
+  &width, &height, &depth)) {
+  /* we can't determine the image size at level=0 */
+  stObj->width0 = stObj->height0 = stObj->depth0 = 0;
+  /* this is not an out of memory error */
+  return GL_TRUE;
}
 
-   /* grow the image size until we hit level = 0 */
-   while (level > 0) {
-  if (width != 1)
- width <<= 1;
-  if (height != 1)
- height <<= 1;
-  if (depth != 1)
- depth <<= 1;
-  level--;
-   }  
-
-   assert(level == 0);
-
/* At this point, (width x height x depth) is the expected size of
 * the level=0 mipmap image.
 */

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


Mesa (master): st/mesa: fix mipmap generation for non-POW textures

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 51f9713e39a4bd6dddff40328ca17632b80c5c81
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=51f9713e39a4bd6dddff40328ca17632b80c5c81

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

st/mesa: fix mipmap generation for non-POW textures

This is part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=34463

---

 src/mesa/state_tracker/st_gen_mipmap.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/state_tracker/st_gen_mipmap.c 
b/src/mesa/state_tracker/st_gen_mipmap.c
index 18eb3be..4bf6828 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -336,6 +336,11 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
if (lastLevel == 0)
   return;
 
+   /* The texture isn't in a "complete" state yet so set the expected
+* lastLevel here, since it won't get done in st_finalize_texture().
+*/
+   stObj->lastLevel = lastLevel;
+
if (pt->last_level < lastLevel) {
   /* The current gallium texture doesn't have space for all the
* mipmap levels we need to generate.  So allocate a new texture.
@@ -353,11 +358,6 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
 oldTex->array_size,
 oldTex->bind);
 
-  /* The texture isn't in a "complete" state yet so set the expected
-   * lastLevel here, since it won't get done in st_finalize_texture().
-   */
-  stObj->lastLevel = lastLevel;
-
   /* This will copy the old texture's base image into the new texture
* which we just allocated.
*/
@@ -366,8 +366,6 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
   /* release the old tex (will likely be freed too) */
   pipe_resource_reference(&oldTex, NULL);
   pipe_sampler_view_reference(&stObj->sampler_view, NULL);
-
-  pt = stObj->pt;
}
else {
   /* Make sure that the base texture image data is present in the
@@ -376,6 +374,8 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
   st_finalize_texture(ctx, st->pipe, texObj);
}
 
+   pt = stObj->pt;
+
assert(pt->last_level >= lastLevel);
 
/* Try to generate the mipmap by rendering/texturing.  If that fails,

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


Mesa (master): mesa: convert macros to inline functions

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: e9ff76aa81d9bd973d46b7e46f1e4ece2112a5b7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9ff76aa81d9bd973d46b7e46f1e4ece2112a5b7

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

mesa: convert macros to inline functions

---

 src/mesa/main/context.h |   44 ++--
 1 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 4e391dd..8c115c7 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -192,41 +192,41 @@ _mesa_Flush( void );
 
 /**
  * Flush vertices.
- *
- * \param ctx GL context.
- * \param newstate new state.
+ * \param newstate  bitmask of _NEW_x flags
  *
  * Checks if dd_function_table::NeedFlush is marked to flush stored vertices,
  * and calls dd_function_table::FlushVertices if so. Marks
  * __struct gl_contextRec::NewState with \p newstate.
  */
-#define FLUSH_VERTICES(ctx, newstate)  \
-do {   \
-   if (MESA_VERBOSE & VERBOSE_STATE)   \
-  _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
-   if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES)  \
-  ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES);   \
-   ctx->NewState |= newstate;  \
-} while (0)
+static INLINE void
+FLUSH_VERTICES(struct gl_context *ctx, GLbitfield newstate)
+{
+   if (MESA_VERBOSE & VERBOSE_STATE)
+  _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);
+   if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES)
+  ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES);
+   ctx->NewState |= newstate;
+}
+
 
 /**
  * Flush current state.
- *
- * \param ctx GL context.
- * \param newstate new state.
+ * \param newstate  bitmask of _NEW_x flags
  *
  * Checks if dd_function_table::NeedFlush is marked to flush current state,
  * and calls dd_function_table::FlushVertices if so. Marks
  * __struct gl_contextRec::NewState with \p newstate.
  */
-#define FLUSH_CURRENT(ctx, newstate)   \
-do {   \
-   if (MESA_VERBOSE & VERBOSE_STATE)   \
-  _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION);\
-   if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)   \
-  ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT);\
-   ctx->NewState |= newstate;  \
-} while (0)
+static INLINE void
+FLUSH_CURRENT(struct gl_context *ctx, GLbitfield newstate)
+{
+   if (MESA_VERBOSE & VERBOSE_STATE)
+  _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION);
+   if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)
+  ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT);
+   ctx->NewState |= newstate;
+}
+
 
 /**
  * Macro to assert that the API call was made outside the

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


Mesa (master): vbo: more comments

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: da9adb9613ff55638e37186c89bfa4a558cafb28
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=da9adb9613ff55638e37186c89bfa4a558cafb28

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: more comments

---

 src/mesa/vbo/vbo_exec_api.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 19bcd0b..c4d39d8 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -932,6 +932,9 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
 }
 
 
+/**
+ * Called upon first glVertex, glColor, glTexCoord, etc.
+ */
 void vbo_exec_BeginVertices( struct gl_context *ctx )
 {
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
@@ -944,6 +947,7 @@ void vbo_exec_BeginVertices( struct gl_context *ctx )
 
 
 /**
+ * Called via ctx->Driver.FlushVertices()
  * \param flags  bitmask of FLUSH_STORED_VERTICES, FLUSH_UPDATE_CURRENT
  */
 void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags )
@@ -957,6 +961,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint 
flags )
 #endif
 
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
+  /* We've had glBegin but not glEnd! */
 #ifdef DEBUG
   exec->flush_call_depth--;
   assert(exec->flush_call_depth == 0);

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


Mesa (master): vbo: remove old debug code, add comments

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: bbd756e824c8d37bc7f8e9138466e8cad067afc5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbd756e824c8d37bc7f8e9138466e8cad067afc5

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: remove old debug code, add comments

---

 src/mesa/vbo/vbo_exec_api.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 7ad8e29..0e1fb3d 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -913,16 +913,22 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
_mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
 }
 
+
 void vbo_exec_BeginVertices( struct gl_context *ctx )
 {
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
-   if (0) printf("%s\n", __FUNCTION__);
+
vbo_exec_vtx_map( exec );
 
assert((exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0);
exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
 }
 
+
+/**
+ * Flush (draw) vertices.
+ * \param  unmap - leave VBO unmapped after flushing?
+ */
 void vbo_exec_FlushVertices_internal( struct gl_context *ctx, GLboolean unmap )
 {
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
@@ -951,10 +957,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, 
GLuint flags )
assert(exec->flush_call_depth == 1);
 #endif
 
-   if (0) printf("%s\n", __FUNCTION__);
-
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
-  if (0) printf("%s - inside begin/end\n", __FUNCTION__);
 #ifdef DEBUG
   exec->flush_call_depth--;
   assert(exec->flush_call_depth == 0);
@@ -962,6 +965,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint 
flags )
   return;
}
 
+   /* Flush (draw), and make sure VBO is left unmapped when done */
vbo_exec_FlushVertices_internal( ctx, GL_TRUE );
 
/* Need to do this to ensure BeginVertices gets called again:

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


Mesa (master): vbo: make vbo_exec_FlushVertices_internal() static

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 6f027ba20d6bb642f1d05cc3ad63169e4f3196e1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f027ba20d6bb642f1d05cc3ad63169e4f3196e1

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: make vbo_exec_FlushVertices_internal() static

---

 src/mesa/vbo/vbo_exec.h |1 -
 src/mesa/vbo/vbo_exec_api.c |   41 -
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index d56c91c..ca100e4 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -152,7 +152,6 @@ struct vbo_exec_context
 void vbo_exec_init( struct gl_context *ctx );
 void vbo_exec_destroy( struct gl_context *ctx );
 void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state );
-void vbo_exec_FlushVertices_internal( struct gl_context *ctx, GLboolean unmap 
);
 
 void vbo_exec_BeginVertices( struct gl_context *ctx );
 void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags );
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 0e1fb3d..19bcd0b 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -533,6 +533,24 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint 
j )
 
 
 /**
+ * Flush (draw) vertices.
+ * \param  unmap - leave VBO unmapped after flushing?
+ */
+static void
+vbo_exec_FlushVertices_internal(struct vbo_exec_context *exec, GLboolean unmap)
+{
+   if (exec->vtx.vert_count || unmap) {
+  vbo_exec_vtx_flush( exec, unmap );
+   }
+
+   if (exec->vtx.vertex_size) {
+  vbo_exec_copy_to_current( exec );
+  reset_attrfv( exec );
+   }
+}
+
+
+/**
  * Called via glBegin.
  */
 static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
@@ -558,7 +576,7 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
* begin/end pairs.
*/
   if (exec->vtx.vertex_size && !exec->vtx.attrsz[0]) 
-vbo_exec_FlushVertices_internal( ctx, GL_FALSE );
+vbo_exec_FlushVertices_internal(exec, GL_FALSE);
 
   i = exec->vtx.prim_count++;
   exec->vtx.prim[i].mode = mode;
@@ -926,25 +944,6 @@ void vbo_exec_BeginVertices( struct gl_context *ctx )
 
 
 /**
- * Flush (draw) vertices.
- * \param  unmap - leave VBO unmapped after flushing?
- */
-void vbo_exec_FlushVertices_internal( struct gl_context *ctx, GLboolean unmap )
-{
-   struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
-
-   if (exec->vtx.vert_count || unmap) {
-  vbo_exec_vtx_flush( exec, unmap );
-   }
-
-   if (exec->vtx.vertex_size) {
-  vbo_exec_copy_to_current( exec );
-  reset_attrfv( exec );
-   }
-}
-
-
-/**
  * \param flags  bitmask of FLUSH_STORED_VERTICES, FLUSH_UPDATE_CURRENT
  */
 void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint flags )
@@ -966,7 +965,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint 
flags )
}
 
/* Flush (draw), and make sure VBO is left unmapped when done */
-   vbo_exec_FlushVertices_internal( ctx, GL_TRUE );
+   vbo_exec_FlushVertices_internal(exec, GL_TRUE);
 
/* Need to do this to ensure BeginVertices gets called again:
 */

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


Mesa (master): vbo: rename, document function params

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 7cba2df4a6f3b4435fe4be277db4a87b2a0f89e3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7cba2df4a6f3b4435fe4be277db4a87b2a0f89e3

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: rename, document function params

---

 src/mesa/vbo/vbo_exec_draw.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index dda008b..5396580 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -354,9 +354,10 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
 
 /**
  * Execute the buffer and save copied verts.
+ * \param keep_unmapped  if true, leave the VBO unmapped when we're done.
  */
 void
-vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
+vbo_exec_vtx_flush(struct vbo_exec_context *exec, GLboolean keepUnmapped)
 {
if (0)
   vbo_exec_debug_verts( exec );
@@ -396,7 +397,7 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, 
GLboolean unmap )
 
 /* If using a real VBO, get new storage -- unless asked not to.
   */
- if (_mesa_is_bufferobj(exec->vtx.bufferobj) && !unmap) {
+ if (_mesa_is_bufferobj(exec->vtx.bufferobj) && !keepUnmapped) {
 vbo_exec_vtx_map( exec );
  }
   }
@@ -404,14 +405,13 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, 
GLboolean unmap )
 
/* May have to unmap explicitly if we didn't draw:
 */
-   if (unmap && 
+   if (keepUnmapped &&
_mesa_is_bufferobj(exec->vtx.bufferobj) &&
exec->vtx.buffer_map) {
   vbo_exec_vtx_unmap( exec );
}
 
-
-   if (unmap || exec->vtx.vertex_size == 0)
+   if (keepUnmapped || exec->vtx.vertex_size == 0)
   exec->vtx.max_vert = 0;
else
   exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / 

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


Mesa (master): vbo: comments

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: f0c8e7c32766cb78756de24a9ca5e8c28017a682
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0c8e7c32766cb78756de24a9ca5e8c28017a682

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: comments

---

 src/mesa/vbo/vbo_exec_draw.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 38c8651..dda008b 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -253,6 +253,9 @@ vbo_exec_bind_arrays( struct gl_context *ctx )
 }
 
 
+/**
+ * Unmap the VBO.  This is called before drawing.
+ */
 static void
 vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
 {
@@ -285,6 +288,9 @@ vbo_exec_vtx_unmap( struct vbo_exec_context *exec )
 }
 
 
+/**
+ * Map the vertex buffer to begin storing glVertex, glColor, etc data.
+ */
 void
 vbo_exec_vtx_map( struct vbo_exec_context *exec )
 {
@@ -306,6 +312,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
 
if (VBO_VERT_BUFFER_SIZE > exec->vtx.buffer_used + 1024 &&
ctx->Driver.MapBufferRange) {
+  /* The VBO exists and there's room for more */
   exec->vtx.buffer_map = 
  (GLfloat *)ctx->Driver.MapBufferRange(ctx, 
target, 
@@ -318,6 +325,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
}

if (!exec->vtx.buffer_map) {
+  /* Need to allocate a new VBO */
   exec->vtx.buffer_used = 0;
 
   ctx->Driver.BufferData(ctx, target, 

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


Mesa (master): vbo: replace assert(0) with proper assertions

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 0ba2810e47d68ec24a93c5fc74cf99afe50e8c9b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ba2810e47d68ec24a93c5fc74cf99afe50e8c9b

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: replace assert(0) with proper assertions

---

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

diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index f8be83e..38c8651 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -301,11 +301,8 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec )
if (!_mesa_is_bufferobj(exec->vtx.bufferobj))
   return;
 
-   if (exec->vtx.buffer_map != NULL) {
-  assert(0);
-  exec->vtx.buffer_map = NULL;
-  exec->vtx.buffer_ptr = NULL;
-   }
+   assert(!exec->vtx.buffer_map);
+   assert(!exec->vtx.buffer_ptr);
 
if (VBO_VERT_BUFFER_SIZE > exec->vtx.buffer_used + 1024 &&
ctx->Driver.MapBufferRange) {

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


Mesa (master): vbo: rename some vars, add new comments, fix formatting, etc .

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: ae4b6e04cdea188f6b5e656a1aafb6c3343fe5a7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae4b6e04cdea188f6b5e656a1aafb6c3343fe5a7

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: rename some vars, add new comments, fix formatting, etc.

---

 src/mesa/vbo/vbo_exec_api.c |  129 --
 src/mesa/vbo/vbo_save_api.c |6 +-
 2 files changed, 77 insertions(+), 58 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 3941524..7ad8e29 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -159,8 +159,7 @@ static void vbo_exec_copy_to_current( struct 
vbo_exec_context *exec )
exec->vtx.attrsz[i], 
exec->vtx.attrptr[i]);
  
- if (memcmp(current, tmp, sizeof(tmp)) != 0)
- { 
+ if (memcmp(current, tmp, sizeof(tmp)) != 0) { 
 memcpy(current, tmp, sizeof(tmp));
 
 /* Given that we explicitly state size here, there is no need
@@ -192,14 +191,18 @@ static void vbo_exec_copy_to_current( struct 
vbo_exec_context *exec )
 }
 
 
-static void vbo_exec_copy_from_current( struct vbo_exec_context *exec )
+/**
+ * Copy current vertex attribute values into the current vertex.
+ */
+static void
+vbo_exec_copy_from_current(struct vbo_exec_context *exec)
 {
struct gl_context *ctx = exec->ctx;
struct vbo_context *vbo = vbo_context(ctx);
GLint i;
 
-   for (i = VBO_ATTRIB_POS+1 ; i < VBO_ATTRIB_MAX ; i++) {
-  const GLfloat *current = (GLfloat *)vbo->currval[i].Ptr;
+   for (i = VBO_ATTRIB_POS + 1; i < VBO_ATTRIB_MAX; i++) {
+  const GLfloat *current = (GLfloat *) vbo->currval[i].Ptr;
   switch (exec->vtx.attrsz[i]) {
   case 4: exec->vtx.attrptr[i][3] = current[3];
   case 3: exec->vtx.attrptr[i][2] = current[2];
@@ -213,17 +216,21 @@ static void vbo_exec_copy_from_current( struct 
vbo_exec_context *exec )
 
 /**
  * Flush existing data, set new attrib size, replay copied vertices.
+ * This is called when we transition from a small vertex attribute size
+ * to a larger one.  Ex: glTexCoord2f -> glTexCoord4f.
+ * We need to go back over the previous 2-component texcoords and insert
+ * zero and one values.
  */ 
-static void vbo_exec_wrap_upgrade_vertex( struct vbo_exec_context *exec,
- GLuint attr,
- GLuint newsz )
+static void
+vbo_exec_wrap_upgrade_vertex(struct vbo_exec_context *exec,
+ GLuint attr, GLuint newSize )
 {
struct gl_context *ctx = exec->ctx;
struct vbo_context *vbo = vbo_context(ctx);
-   GLint lastcount = exec->vtx.vert_count;
+   const GLint lastcount = exec->vtx.vert_count;
GLfloat *old_attrptr[VBO_ATTRIB_MAX];
-   GLuint old_vtx_size = exec->vtx.vertex_size;
-   GLuint oldsz = exec->vtx.attrsz[attr];
+   const GLuint old_vtx_size = exec->vtx.vertex_size; /* floats per vertex */
+   const GLuint oldSize = exec->vtx.attrsz[attr];
GLuint i;
 
/* Run pipeline on current vertices, copy wrapped vertices
@@ -239,7 +246,7 @@ static void vbo_exec_wrap_upgrade_vertex( struct 
vbo_exec_context *exec,
   memcpy(old_attrptr, exec->vtx.attrptr, sizeof(old_attrptr));
}
 
-   if (unlikely(oldsz)) {
+   if (unlikely(oldSize)) {
   /* Do a COPY_TO_CURRENT to ensure back-copying works for the
* case when the attribute already exists in the vertex and is
* having its size increased.
@@ -251,21 +258,21 @@ static void vbo_exec_wrap_upgrade_vertex( struct 
vbo_exec_context *exec,
 * begin/end so that they don't bloat the vertices.
 */
if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END &&
-   !oldsz && lastcount > 8 && exec->vtx.vertex_size) {
+   !oldSize && lastcount > 8 && exec->vtx.vertex_size) {
   vbo_exec_copy_to_current( exec );
   reset_attrfv( exec );
}
 
/* Fix up sizes:
 */
-   exec->vtx.attrsz[attr] = newsz;
-   exec->vtx.vertex_size += newsz - oldsz;
+   exec->vtx.attrsz[attr] = newSize;
+   exec->vtx.vertex_size += newSize - oldSize;
exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / 
  (exec->vtx.vertex_size * sizeof(GLfloat)));
exec->vtx.vert_count = 0;
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
 
-   if (unlikely(oldsz)) {
+   if (unlikely(oldSize)) {
   /* Size changed, recalculate all the attrptr[] values
*/
   GLfloat *tmp = exec->vtx.vertex;
@@ -283,11 +290,11 @@ static void vbo_exec_wrap_upgrade_vertex( struct 
vbo_exec_context *exec,
* values.
*/
   vbo_exec_copy_from_current( exec );
-
-   } else {
+   }
+   else {
   /* Just have to append the new attribute at the end */
   exec->vtx.attrptr[attr] = exec->vtx.vertex +
-exec->vtx.vertex_size - newsz;
+exec->vtx.vertex_size - newSize;
}
 
   

Mesa (master): vbo: use ctx instead of exec->ctx

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: 8b2598d000e4002bd0f07bf1eeecf4488fb6627c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8b2598d000e4002bd0f07bf1eeecf4488fb6627c

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

vbo: use ctx instead of exec->ctx

---

 src/mesa/vbo/vbo_exec_api.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 03d6bb4..3941524 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -376,7 +376,7 @@ static void vbo_exec_fixup_vertex( struct gl_context *ctx,
 do {   \
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;\
\
-   if (unlikely(!(exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT))) \
+   if (unlikely(!(ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)))  \
   ctx->Driver.BeginVertices( ctx ); \
if (unlikely(exec->vtx.active_sz[A] != N))  \
   vbo_exec_fixup_vertex(ctx, A, N);
\
@@ -395,8 +395,8 @@ do {
\
   for (i = 0; i < exec->vtx.vertex_size; i++)  \
 exec->vtx.buffer_ptr[i] = exec->vtx.vertex[i]; \
\
-  exec->vtx.buffer_ptr += exec->vtx.vertex_size;   \
-  exec->ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;\
+  exec->vtx.buffer_ptr += exec->vtx.vertex_size;   \
+  ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;  \
\
   if (++exec->vtx.vert_count >= exec->vtx.max_vert)\
 vbo_exec_vtx_wrap( exec ); \

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


Mesa (master): radeon: add default switch case to silence unhandled enum warning

2011-02-21 Thread Brian Paul
Module: Mesa
Branch: master
Commit: f9e1542286a05e9773f8f31ee75887f6da969cdb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9e1542286a05e9773f8f31ee75887f6da969cdb

Author: Brian Paul 
Date:   Mon Feb 21 15:11:44 2011 -0700

radeon: add default switch case to silence unhandled enum warning

---

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

diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c 
b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 6656d39..d3c9257 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -485,6 +485,8 @@ radeon_update_wrapper(struct gl_context *ctx, struct 
radeon_renderbuffer *rrb,
case MESA_FORMAT_S8_Z24:
rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT;
break;
+   default:
+   _mesa_problem(ctx, "Unexpected texture format in 
radeon_update_wrapper()");
}

rrb->cpp = _mesa_get_format_bytes(texImage->TexFormat);

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


Mesa (master): Use C-style system headers in C++ code to avoid issues with std:: namespace

2011-02-21 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: 497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f

Author: Ian Romanick 
Date:   Thu Feb 10 10:26:42 2011 -0800

Use C-style system headers in C++ code to avoid issues with std:: namespace

---

 src/glsl/ast_expr.cpp |5 +
 src/glsl/ast_type.cpp |3 ---
 src/glsl/glsl_parser_extras.h |2 +-
 src/glsl/glsl_types.cpp   |2 +-
 src/glsl/glsl_types.h |4 ++--
 src/glsl/hir_field_selection.cpp  |2 --
 src/glsl/ir.h |4 ++--
 src/glsl/ir_import_prototypes.cpp |1 -
 src/glsl/ir_print_visitor.cpp |3 ---
 src/glsl/ir_validate.cpp  |3 ---
 src/glsl/link_functions.cpp   |4 
 src/glsl/linker.cpp   |4 
 src/glsl/loop_controls.cpp|2 +-
 src/glsl/lower_mat_op_to_vec.cpp  |3 ---
 src/glsl/main.cpp |2 --
 src/glsl/opt_constant_propagation.cpp |2 --
 src/glsl/opt_constant_variable.cpp|3 ---
 src/glsl/opt_dead_code.cpp|2 --
 src/glsl/opt_dead_code_local.cpp  |2 --
 src/glsl/opt_dead_functions.cpp   |2 --
 src/glsl/opt_structure_splitting.cpp  |3 ---
 src/glsl/opt_swizzle_swizzle.cpp  |2 --
 src/glsl/opt_tree_grafting.cpp|2 --
 src/glsl/s_expression.cpp |3 ---
 src/mesa/program/sampler.cpp  |1 -
 25 files changed, 8 insertions(+), 58 deletions(-)

diff --git a/src/glsl/ast_expr.cpp b/src/glsl/ast_expr.cpp
index 974beb9..e624d11 100644
--- a/src/glsl/ast_expr.cpp
+++ b/src/glsl/ast_expr.cpp
@@ -20,12 +20,9 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include 
-#include 
+#include 
 #include "ast.h"
 
-using std::printf;
-
 const char *
 ast_expression::operator_string(enum ast_operators op)
 {
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 5ddfeec..c680ae5 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -21,14 +21,11 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
 #include "ast.h"
 extern "C" {
 #include "program/symbol_table.h"
 }
 
-using std::printf;
-
 void
 ast_type_specifier::print(void) const
 {
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 8d4fca7..10cb673 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -31,7 +31,7 @@
 #ifdef __cplusplus
 
 
-#include 
+#include 
 #include "glsl_symbol_table.h"
 
 enum _mesa_glsl_parser_targets {
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index f4d9242..76b4f3e 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
+#include 
 #include 
 #include "main/core.h" /* for Elements */
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index ab6858f..61bf5e0 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -26,8 +26,8 @@
 #ifndef GLSL_TYPES_H
 #define GLSL_TYPES_H
 
-#include 
-#include 
+#include 
+#include 
 
 extern "C" {
 #include "GL/gl.h"
diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp
index 995f284..3c33127 100644
--- a/src/glsl/hir_field_selection.cpp
+++ b/src/glsl/hir_field_selection.cpp
@@ -27,8 +27,6 @@
 #include "ast.h"
 #include "glsl_types.h"
 
-using std::strcmp;
-
 ir_rvalue *
 _mesa_ast_field_selection_to_hir(const ast_expression *expr,
 exec_list *instructions,
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 74a8b06..f2f902c 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -26,8 +26,8 @@
 #ifndef IR_H
 #define IR_H
 
-#include 
-#include 
+#include 
+#include 
 
 #include "ralloc.h"
 #include "glsl_types.h"
diff --git a/src/glsl/ir_import_prototypes.cpp 
b/src/glsl/ir_import_prototypes.cpp
index be5e0c1..3585bf6 100644
--- a/src/glsl/ir_import_prototypes.cpp
+++ b/src/glsl/ir_import_prototypes.cpp
@@ -27,7 +27,6 @@
  *
  * \author Ian Romanick
  */
-#include 
 #include "ir.h"
 #include "glsl_symbol_table.h"
 
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index be76945..82ccc72 100644
--- a/src/glsl/ir_print_visitor.cpp
+++ b/src/glsl/ir_print_visitor.cpp
@@ -25,9 +25,6 @@
 #include "glsl_types.h"
 #include "glsl_parser_extras.h"
 
-using std::printf;
-using std::strncmp;
-
 static void print_type(const glsl_type *t);
 
 void
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index b0dd6c2..44d7549 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -39,9 +39,6 @@
 #include "program/hash_table.h"
 #include "glsl_types.h"
 
-using std::abort;
-using std::printf;
-
 class ir_validate : public ir_hierarchical_visitor {
 public:
ir_validate()
diff --git a/src/gls

Mesa (master): intel: Fix insufficient integer width for upload buffer offset

2011-02-21 Thread Chris Wilson
Module: Mesa
Branch: master
Commit: 5a1fbf0f70a1c2d444f61494f86e26ca866c31d5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a1fbf0f70a1c2d444f61494f86e26ca866c31d5

Author: Chris Wilson 
Date:   Mon Feb 21 20:56:06 2011 +

intel: Fix insufficient integer width for upload buffer offset

I was being overly miserly and gave the offset of the buffer into the bo
insufficient bits, distracted by the adjacency of the buffer[4096].

Ref: https://bugs.freedesktop.org/show_bug.cgi?id=34541
Signed-off-by: Chris Wilson 

---

 src/mesa/drivers/dri/intel/intel_context.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_context.h 
b/src/mesa/drivers/dri/intel/intel_context.h
index 1ab38b1..772b2fb 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -201,8 +201,8 @@ struct intel_context
struct {
   drm_intel_bo *bo;
   GLuint offset;
-  uint16_t buffer_len;
-  uint16_t buffer_offset;
+  uint32_t buffer_len;
+  uint32_t buffer_offset;
   char buffer[4096];
} upload;
 

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


Mesa (master): svga: Remove some remaining fake S3TC rendering support.

2011-02-21 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: dcb21d8b1cc3962faac600dabc87f3038acb5c5d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dcb21d8b1cc3962faac600dabc87f3038acb5c5d

Author: José Fonseca 
Date:   Mon Feb 21 18:24:36 2011 +

svga: Remove some remaining fake S3TC rendering support.

---

 src/gallium/drivers/svga/svga_sampler_view.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_sampler_view.c 
b/src/gallium/drivers/svga/svga_sampler_view.c
index 49cae2d..4f1f4b5 100644
--- a/src/gallium/drivers/svga/svga_sampler_view.c
+++ b/src/gallium/drivers/svga/svga_sampler_view.c
@@ -79,10 +79,6 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
   if (min_lod == 0 && max_lod >= pt->last_level)
  view = FALSE;
 
-  if (util_format_is_s3tc(pt->format) && view) {
- format = svga_translate_format_render(pt->format);
-  }
-
   if (ss->debug.no_sampler_view)
  view = FALSE;
 

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


Mesa (master): i965: Remove spurious duplicate ADVANCE_BATCH

2011-02-21 Thread Chris Wilson
Module: Mesa
Branch: master
Commit: a43f20e0699f0b60d1e1e3e7a0693192f8d2895d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a43f20e0699f0b60d1e1e3e7a0693192f8d2895d

Author: Chris Wilson 
Date:   Mon Feb 21 16:02:26 2011 +

i965: Remove spurious duplicate ADVANCE_BATCH

... a leftover from a bad merge.

Signed-off-by: Chris Wilson 

---

 src/mesa/drivers/dri/i965/brw_draw_upload.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c 
b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 09d7a5e..17af046 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -559,7 +559,6 @@ static void brw_emit_vertices(struct brw_context *brw)
   brw->vb.nr_current_buffers = i;
   ADVANCE_BATCH();
}
-   ADVANCE_BATCH();
 
BEGIN_BATCH(1 + brw->vb.nr_enabled * 2);
OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | (2*brw->vb.nr_enabled - 1));

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


Mesa (master): 33 new commits

2011-02-21 Thread Chris Wilson
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c6793fb6bc89df16c23f727bcb072a157ab8d10
Author: Chris Wilson 
Date:   Thu Nov 25 15:41:37 2010 +

i915: Emit a single relocation per vbo

Reducing the number of relocations has lots of nice knock-on effects,
not least including reducing batch buffer size, auxilliary array sizes
(vmalloced and copied into the kernel), processing of uncached
relocations etc.

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=298ebb78de8a6b6edf0aa0fe8d784d00bbc2930e
Author: Chris Wilson 
Date:   Fri Nov 26 11:18:50 2010 +

i915: Suppress emission of redundant stencil updates

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c97e288fb6a105ea60c377aef4472cc33ca01bc
Author: Chris Wilson 
Date:   Fri Nov 26 10:57:06 2010 +

i915: Separate BLEND from general context state.

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f82585e279276e08c719d55218cd64a2c880a6b
Author: Chris Wilson 
Date:   Fri Nov 26 10:25:23 2010 +

i915: Only flag context changes if the actual state is changed

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b0cad38c57fbe59710cb4058866b2e68f6d471a
Author: Chris Wilson 
Date:   Thu Nov 25 22:27:37 2010 +

i915: suppress repeated sampler state emission

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=87641cffd97f328e846604d314c21582f426a19a
Author: Chris Wilson 
Date:   Thu Nov 25 21:39:21 2010 +

i915: Eliminate redundant CONSTANTS updates

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=41260a9bf63aa61f88f188053f1ed4dba3a852d2
Author: Chris Wilson 
Date:   Tue Feb 8 22:58:35 2011 +

i965: Use compiler builtins when available

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ea6e98c7be6483514769b03ffa6c6f4f7b2e0be
Author: Chris Wilson 
Date:   Sun Feb 20 15:36:52 2011 +

i965: Micro-optimise check_state

Replace the intermediate tests due to the logical or with the bitwise
or.

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=50ade6ea697953bb17e3ca7210515fbd0411cd1e
Author: Chris Wilson 
Date:   Thu Dec 30 21:47:39 2010 +

intel: use throttle ioctl for throttling

Rather than waiting on the first batch after the last swapbuffers to be
retired, call into the kernel to wait upon the retirement of any request
less than 20ms old. This has the twofold advantage of (a) not blocking
any other clients from utilizing the device whilst we wait and (b) we
attain higher throughput without overloading the system.

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=46131a824ffa3b658c822fd6cc543a5935773a6f
Author: Chris Wilson 
Date:   Sat Feb 12 11:28:25 2011 +

i965: Remove unused 'next_free_page' member

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=57ca0803b34587f1148b218a11d2193b0d4f4c97
Author: Chris Wilson 
Date:   Fri Feb 11 00:03:48 2011 +

intel: Skip the flush before read-pixels via blit

As we will flush when reading the return values of the blit, we can forgo
the earlier flush.

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c625aa19cb53ed27f91bfd16fea6ea727e9a5bbd
Author: Chris Wilson 
Date:   Fri Feb 18 10:37:43 2011 +

intel: extend current vertex buffers

If the next vertex arrays are a (discontiguous) continuation of the
current arrays, such that the new vertices are simply offset from the
start of the current vertex buffer definitions we can reuse those
defintions and avoid the overhead of relocations and invalidations.

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a07e4811794051dc65187d17b7f85e340e61854e
Author: Chris Wilson 
Date:   Fri Feb 18 12:30:37 2011 +

intel: Use specified alignment for writes into the upload buffer

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9e591391d490c83ce301aa568a2e0afe4cc3c0a
Author: Chris Wilson 
Date:   Fri Feb 11 15:29:26 2011 +

i965: Clean up brw_prepare_vertices()

Use a temporary glarray variable to replace the numerous input->glarray.

Signed-off-by: Chris Wilson 

URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3630d5b69afcecc3142d2c4897835175886f4bd8
Author: Chris Wilson 
Date:   Fri Feb 11 19:40:08 2011 +

intel: combine short memcpy using a temporary allocated buffer

Using a temporary buffer for large discontiguous uploads into the common
buffer