Mesa (master): i965: Zero the offset into the vbo when uploading non-interleaved

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

Author: Chris Wilson ch...@chris-wilson.co.uk
Date:   Tue Feb 22 11:18:25 2011 +

i965: Zero the offset into the vbo when uploading non-interleaved

Fixes regression from 559435d9152acc7162e4e60aae6591c7c6c8274b.

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

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c 
b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index b15c05a..6ea877b 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -454,6 +454,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
  upload[i], brw-vb.buffers[j],
  upload[i]-element_size);
   upload[i]-buffer = j++;
+  upload[i]-offset = 0;
}
 
/* can we simply extend the current vb? */

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


Mesa (master): i965: Reinstate max-index paranoia

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

Author: Chris Wilson ch...@chris-wilson.co.uk
Date:   Tue Feb 22 11:19:32 2011 +

i965: Reinstate max-index paranoia

Don't trust the applications not to reference beyond the end of the
vertex buffers.

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

---

 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 6ea877b..4520749 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -550,7 +550,7 @@ static void brw_emit_vertices(struct brw_context *brw)
 if (intel-gen = 5) {
OUT_RELOC(buffer-bo, I915_GEM_DOMAIN_VERTEX, 0, buffer-bo-size - 
1);
 } else
-   OUT_BATCH(0);
+   OUT_BATCH(buffer-bo-size / buffer-stride);
 OUT_BATCH(0); /* Instance data step rate */
 
 brw-vb.current_buffers[i].handle = buffer-bo-handle;

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


Mesa (master): i965: Trim the interleaved upload to the minimum number of vertices

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

Author: Chris Wilson ch...@chris-wilson.co.uk
Date:   Tue Feb 22 11:17:39 2011 +

i965: Trim the interleaved upload to the minimum number of vertices

... should have no impact on a properly formatted draw operation.

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

---

 src/mesa/drivers/dri/i965/brw_draw_upload.c |6 +-
 1 files changed, 5 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 4520749..140fb4e 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -272,7 +272,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
struct intel_context *intel = intel_context(ctx);
GLbitfield vs_inputs = brw-vs.prog_data-inputs_read; 
const unsigned char *ptr = NULL;
-   GLuint interleaved = 0, total_size = 0;
+   GLuint interleaved = 0, total_size = 0, count = -1;
unsigned int min_index = brw-vb.min_index;
unsigned int max_index = brw-vb.max_index;
int i, j;
@@ -390,6 +390,9 @@ static void brw_prepare_vertices(struct brw_context *brw)
interleaved = 0;
 }
 
+if (count  input-count)
+   count = input-count;
+
 upload[nr_uploads++] = input;
 total_size += input-element_size;
   }
@@ -401,6 +404,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
 /* All uploads are interleaved, so upload the arrays together as
  * interleaved.  First, upload the contents and set up upload[0].
  */
+upload[0]-count = count; /* trim the upload over all arrays */
 copy_array_to_vbo_array(brw,
 upload[0], brw-vb.buffers[j],
 interleaved);

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


Mesa (master): st/mesa: fix crash when DrawBuffer-_ColorDrawBuffers[0] is NULL

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

Author: Marek Olšák mar...@gmail.com
Date:   Sun Feb 20 16:50:48 2011 +0100

st/mesa: fix crash when DrawBuffer-_ColorDrawBuffers[0] is NULL

This fixes the game Tiny and Big.

---

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

diff --git a/src/mesa/state_tracker/st_cb_clear.c 
b/src/mesa/state_tracker/st_cb_clear.c
index d81e554..0e0c432 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -300,9 +300,11 @@ 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);
 
-   st_translate_color(ctx-Color.ClearColor,
-  ctx-DrawBuffer-_ColorDrawBuffers[0]-_BaseFormat,
-  clearColor);
+   if (ctx-DrawBuffer-_ColorDrawBuffers[0]) {
+  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);
@@ -555,9 +557,11 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
ctx-DrawBuffer-Visual.stencilBits == 0))
  clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
 
-  st_translate_color(ctx-Color.ClearColor,
- ctx-DrawBuffer-_ColorDrawBuffers[0]-_BaseFormat,
- clearColor);
+  if (ctx-DrawBuffer-_ColorDrawBuffers[0]) {
+ st_translate_color(ctx-Color.ClearColor,
+ctx-DrawBuffer-_ColorDrawBuffers[0]-_BaseFormat,
+clearColor);
+  }
 
   st-pipe-clear(st-pipe, clear_buffers, ctx-Color.ClearColor,
   ctx-Depth.Clear, ctx-Stencil.Clear);

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


Mesa (master): st/mesa: fix crash when using both user and vbo buffers with the same stride

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

Author: Marek Olšák mar...@gmail.com
Date:   Sun Feb 20 18:05:24 2011 +0100

st/mesa: fix crash when using both user and vbo buffers with the same stride

If two buffers had the same stride where one buffer is a user one and
the other is a vbo, it was considered to be one interleaved buffer,
resulting in incorrect rendering and crashes.

This patch makes sure that the interleaved buffer is either user or vbo,
not both.

---

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

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 5475e87..11ebd06 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -249,6 +249,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp,
const struct gl_buffer_object *firstBufObj = NULL;
GLint firstStride = -1;
const GLubyte *client_addr = NULL;
+   GLboolean user_memory;
 
for (attr = 0; attr  vpv-num_inputs; attr++) {
   const GLuint mesaAttr = vp-index_to_input[attr];
@@ -257,6 +258,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp,
 
   if (firstStride  0) {
  firstStride = stride;
+ user_memory = !bufObj || !bufObj-Name;
   }
   else if (firstStride != stride) {
  return GL_FALSE;
@@ -266,6 +268,9 @@ is_interleaved_arrays(const struct st_vertex_program *vp,
  /* Try to detect if the client-space arrays are
   * close to each other.
   */
+ if (!user_memory) {
+return GL_FALSE;
+ }
  if (!client_addr) {
 client_addr = arrays[mesaAttr]-Ptr;
  }
@@ -275,6 +280,9 @@ is_interleaved_arrays(const struct st_vertex_program *vp,
  }
   }
   else if (!firstBufObj) {
+ if (user_memory) {
+return GL_FALSE;
+ }
  firstBufObj = bufObj;
   }
   else if (bufObj != firstBufObj) {

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


Mesa (7.9): mesa: include compiler.h for ASSERT macro

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 07:17:32 2011 -0700

mesa: include compiler.h for ASSERT macro

This was already done in the 7.10 branch and master.

---

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

diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index f8f3798..03b1066 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -40,6 +40,7 @@
 #ifndef PROGRAM_H
 #define PROGRAM_H
 
+#include main/compiler.h
 #include main/mtypes.h
 
 

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


Mesa (master): gallium: new transfer flag: DISCARD_WHOLE_RESOURCE

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

Author: Keith Whitwell kei...@vmware.com
Date:   Wed Jan  5 17:33:43 2011 +

gallium: new transfer flag: DISCARD_WHOLE_RESOURCE

---

 src/gallium/include/pipe/p_defines.h |   21 ++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index f66bbaf..8b56552 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -229,9 +229,9 @@ enum pipe_transfer_usage {
 *
 * See also:
 * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_RANGE_BIT flag.
-* - Direct3D's D3DLOCK_DISCARD flag.
 */
-   PIPE_TRANSFER_DISCARD = (1  8),
+   PIPE_TRANSFER_DISCARD = (1  8), /* DEPRECATED */
+   PIPE_TRANSFER_DISCARD_RANGE = (1  8),
 
/**
 * Fail if the resource cannot be mapped immediately.
@@ -266,7 +266,22 @@ enum pipe_transfer_usage {
 * - pipe_context::transfer_flush_region
 * - OpenGL's ARB_map_buffer_range extension, MAP_FLUSH_EXPLICIT_BIT flag.
 */
-   PIPE_TRANSFER_FLUSH_EXPLICIT = (1  11)
+   PIPE_TRANSFER_FLUSH_EXPLICIT = (1  11),
+
+   /**
+* Discards all memory backing the resource.
+*
+* It should not be used with PIPE_TRANSFER_CPU_READ.
+*
+* This is equivalent to:
+* - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_BUFFER_BIT
+* - BufferData(NULL) on a GL buffer
+* - Direct3D's D3DLOCK_DISCARD flag.
+* - WDDM's D3DDDICB_LOCKFLAGS.Discard flag.
+* - D3D10 DDI's D3D10_DDI_MAP_WRITE_DISCARD flag
+* - D3D10's D3D10_MAP_WRITE_DISCARD flag.
+*/
+   PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE = (1  12)
 
 };
 

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


Mesa (master): gallium/docs: Update PIPE_TRANSFER_xx docs. Reformat to use definitions.

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

Author: José Fonseca jfons...@vmware.com
Date:   Tue Feb 22 14:14:22 2011 +

gallium/docs: Update PIPE_TRANSFER_xx docs. Reformat to use definitions.

---

 src/gallium/docs/source/context.rst |   42 --
 1 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/src/gallium/docs/source/context.rst 
b/src/gallium/docs/source/context.rst
index 04a3951..c6812cd 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
@@ -415,16 +415,32 @@ PIPE_TRANSFER
 
 These flags control the behavior of a transfer object.
 
-* ``READ``: resource contents are read at transfer create time.
-* ``WRITE``: resource contents will be written back at transfer destroy time.
-* ``MAP_DIRECTLY``: a transfer should directly map the resource. May return
-  NULL if not supported.
-* ``DISCARD``: The memory within the mapped region is discarded.
-  Cannot be used with ``READ``.
-* ``DONTBLOCK``: Fail if the resource cannot be mapped immediately.
-* ``UNSYNCHRONIZED``: Do not synchronize pending operations on the resource
-  when mapping. The interaction of any writes to the map and any
-  operations pending on the resource are undefined. Cannot be used with
-  ``READ``.
-* ``FLUSH_EXPLICIT``: Written ranges will be notified later with
-  :ref:`transfer_flush_region`. Cannot be used with ``READ``.
+``PIPE_TRANSFER_READ``
+  Resource contents read back (or accessed directly) at transfer create time.
+
+``PIPE_TRANSFER_WRITE``
+  Resource contents will be written back at transfer_destroy time (or modified
+  as a result of being accessed directly).
+
+``PIPE_TRANSFER_MAP_DIRECTLY``
+  a transfer should directly map the resource. May return NULL if not 
supported.
+
+``PIPE_TRANSFER_DISCARD_RANGE``
+  The memory within the mapped region is discarded.  Cannot be used with
+  ``PIPE_TRANSFER_READ``.
+
+``PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE``
+  Discards all memory backing the resource.  It should not be used with
+  ``PIPE_TRANSFER_READ``.
+
+``PIPE_TRANSFER_DONTBLOCK``
+  Fail if the resource cannot be mapped immediately.
+
+``PIPE_TRANSFER_UNSYNCHRONIZED``
+  Do not synchronize pending operations on the resource when mapping. The
+  interaction of any writes to the map and any operations pending on the
+  resource are undefined. Cannot be used with ``PIPE_TRANSFER_READ``.
+
+``PIPE_TRANSFER_FLUSH_EXPLICIT``
+  Written ranges will be notified later with :ref:`transfer_flush_region`.
+  Cannot be used with ``PIPE_TRANSFER_READ``.

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


Mesa (master): gallium: s/PIPE_TRANSFER_CPU_READ/PIPE_TRANSFER_READ/ in comments.

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

Author: José Fonseca jfons...@vmware.com
Date:   Tue Feb 22 14:14:45 2011 +

gallium: s/PIPE_TRANSFER_CPU_READ/PIPE_TRANSFER_READ/ in comments.

---

 src/gallium/include/pipe/p_defines.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index 8b56552..81da4b8 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -225,7 +225,7 @@ enum pipe_transfer_usage {
/**
 * Discards the memory within the mapped region.
 *
-* It should not be used with PIPE_TRANSFER_CPU_READ.
+* It should not be used with PIPE_TRANSFER_READ.
 *
 * See also:
 * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_RANGE_BIT flag.
@@ -246,7 +246,7 @@ enum pipe_transfer_usage {
/**
 * Do not attempt to synchronize pending operations on the resource when 
mapping.
 *
-* It should not be used with PIPE_TRANSFER_CPU_READ.
+* It should not be used with PIPE_TRANSFER_READ.
 *
 * See also:
 * - OpenGL's ARB_map_buffer_range extension, MAP_UNSYNCHRONIZED_BIT flag.
@@ -260,7 +260,7 @@ enum pipe_transfer_usage {
 * Written ranges will be notified later with
 * pipe_context::transfer_flush_region.
 *
-* It should not be used with PIPE_TRANSFER_CPU_READ.
+* It should not be used with PIPE_TRANSFER_READ.
 *
 * See also:
 * - pipe_context::transfer_flush_region
@@ -271,7 +271,7 @@ enum pipe_transfer_usage {
/**
 * Discards all memory backing the resource.
 *
-* It should not be used with PIPE_TRANSFER_CPU_READ.
+* It should not be used with PIPE_TRANSFER_READ.
 *
 * This is equivalent to:
 * - OpenGL's ARB_map_buffer_range extension, MAP_INVALIDATE_BUFFER_BIT

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


Mesa (master): mesa: Avoid undeclared ffs function warning on mingw.

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

Author: José Fonseca jfons...@vmware.com
Date:   Tue Feb 22 14:59:09 2011 +

mesa: Avoid undeclared ffs function warning on mingw.

---

 src/mesa/main/imports.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index a994dbc..ce7baab 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -540,6 +540,12 @@ extern void
 _mesa_init_sqrt_table(void);
 
 #ifdef __GNUC__
+
+#ifdef __MINGW32__
+#define ffs __builtin_ffs
+#define ffsll __builtin_ffsll
+#endif
+
 #define _mesa_ffs(i)  ffs(i)
 #define _mesa_ffsll(i)  ffsll(i)
 

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


Mesa (7.9): glsl: add ir_shader case in switch stmt to silence warning

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 08:17:21 2011 -0700

glsl: add ir_shader case in switch stmt to silence warning

---

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

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 4f2bce6..14e6b18 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1714,6 +1714,8 @@ apply_type_qualifier_to_variable(const struct 
ast_type_qualifier *qual,
 if (var-mode == ir_var_in)
var-invariant = true;
 break;
+  case ir_shader:
+ ; /* no op */
   }
}
 

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


Mesa (7.9): glsl2: fix signed/unsigned comparison warning

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Oct 12 08:54:16 2010 -0600

glsl2: fix signed/unsigned comparison warning
(cherry picked from commit 3633e1f538e42ac04700aa98b48e3157b3406c14)

---

 src/glsl/loop_unroll.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/loop_unroll.cpp b/src/glsl/loop_unroll.cpp
index 57ab84a..5b84e10 100644
--- a/src/glsl/loop_unroll.cpp
+++ b/src/glsl/loop_unroll.cpp
@@ -75,7 +75,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
 
/* Don't try to unroll loops that have zillions of iterations either.
 */
-   if (iterations  max_iterations)
+   if (iterations  (int) max_iterations)
   return visit_continue;
 
if (ls-num_loop_jumps  1)

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


Mesa (master): i965/fs: Apply source modifier workarounds to POW as well.

2011-02-22 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 72cd7e87d35e96fad9643f1cee706a8568fa3fa1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=72cd7e87d35e96fad9643f1cee706a8568fa3fa1

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sat Feb 19 01:03:08 2011 -0800

i965/fs: Apply source modifier workarounds to POW as well.

Single-operand math already had these workarounds, but POW (the only two
operand function) did not.  It needs them too - otherwise we can hit
assertion failures in brw_eu_emit.c when code is actually generated.

NOTE: This is a candidate for the 7.10 branch.

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

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 8fd120c..66bbdbe 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -661,14 +661,18 @@ fs_visitor::emit_math(fs_opcodes opcode, fs_reg dst, 
fs_reg src0, fs_reg src1)
assert(opcode == FS_OPCODE_POW);
 
if (intel-gen = 6) {
-  /* Can't do hstride == 0 args to gen6 math, so expand it out. */
-  if (src0.file == UNIFORM) {
+  /* Can't do hstride == 0 args to gen6 math, so expand it out.
+   *
+   * The hardware ignores source modifiers (negate and abs) on math
+   * instructions, so we also move to a temp to set those up.
+   */
+  if (src0.file == UNIFORM || src0.abs || src0.negate) {
 fs_reg expanded = fs_reg(this, glsl_type::float_type);
 emit(fs_inst(BRW_OPCODE_MOV, expanded, src0));
 src0 = expanded;
   }
 
-  if (src1.file == UNIFORM) {
+  if (src1.file == UNIFORM || src1.abs || src1.negate) {
 fs_reg expanded = fs_reg(this, glsl_type::float_type);
 emit(fs_inst(BRW_OPCODE_MOV, expanded, src1));
 src1 = expanded;

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


Mesa (master): i965: Fix shaders that write to gl_PointSize on Sandybridge.

2011-02-22 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 3e91070ea81da970b640acf22e2b1aa761161906
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e91070ea81da970b640acf22e2b1aa761161906

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Tue Feb 22 10:04:18 2011 -0800

i965: Fix shaders that write to gl_PointSize on Sandybridge.

gl_PointSize (VERT_RESULT_PSIZ) doesn't take up a message register,
as it's part of the header.  Without this fix, writing to gl_PointSize
would cause the SF to read and use the wrong attributes, leading to all
kinds of random looking failure.

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

---

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

diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c 
b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index f277829..06ed89f 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -54,6 +54,8 @@ get_attr_override(struct brw_context *brw, int fs_attr, int 
two_side_color)
 * be FRAG_ATTRIB_*.
 */
for (i = 1; i  vs_attr; i++) {
+  if (i == VERT_RESULT_PSIZ)
+continue;
   if (brw-vs.prog_data-outputs_written  BITFIELD64_BIT(i))
 attr_index++;
}

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


Mesa (master): i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.

2011-02-22 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 4a3b28113c3d23ba21bb8b8f5ebab7c567083a6d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a3b28113c3d23ba21bb8b8f5ebab7c567083a6d

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sat Feb 19 16:48:24 2011 -0800

i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.

pixel_w is the final result; wpos_w is used on gen4 to compute it.

NOTE: This is a candidate for the 7.10 branch.

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

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c6c6497..30e3bd5 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -494,7 +494,7 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)
wpos.reg_offset++;
 
/* gl_FragCoord.w: Already set up in emit_interpolation */
-   emit(fs_inst(BRW_OPCODE_MOV, wpos, this-wpos_w));
+   emit(fs_inst(BRW_OPCODE_MOV, wpos, this-pixel_w));
 
return reg;
 }

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


Mesa (master): i965/fs: Avoid register coalescing away gen6 MATH workarounds.

2011-02-22 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 2c2686b912de19a430aba9f5ea5fa679eabdc5c6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c2686b912de19a430aba9f5ea5fa679eabdc5c6

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sat Feb 19 01:05:11 2011 -0800

i965/fs: Avoid register coalescing away gen6 MATH workarounds.

The code that generates MATH instructions attempts to work around
the hardware ignoring source modifiers (abs and negate) by emitting
moves into temporaries.  Unfortunately, this pass coalesced those
registers, restoring the original problem.  Avoid doing that.

Fixes several OpenGL ES2 conformance failures on Sandybridge.

NOTE: This is a candidate for the 7.10 branch.

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

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 66bbdbe..ed973f4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3059,6 +3059,8 @@ fs_visitor::register_coalesce()
  inst-dst.type != inst-src[0].type)
 continue;
 
+  bool has_source_modifiers = inst-src[0].abs || inst-src[0].negate;
+
   /* Found a move of a GRF to a GRF.  Let's see if we can coalesce
* them: check for no writes to either one until the exit of the
* program.
@@ -3083,6 +3085,14 @@ fs_visitor::register_coalesce()
   break;
}
 }
+
+/* The gen6 MATH instruction can't handle source modifiers, so avoid
+ * coalescing those for now.  We should do something more specific.
+ */
+if (intel-gen == 6  scan_inst-is_math()  has_source_modifiers) {
+   interfered = true;
+   break;
+}
   }
   if (interfered) {
 continue;

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


Mesa (master): i965: Increase Sandybridge point size clamp.

2011-02-22 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: 2bfc23fb86964e4153f57f2a56248760f6066033
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2bfc23fb86964e4153f57f2a56248760f6066033

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sat Feb 19 17:22:47 2011 -0800

i965: Increase Sandybridge point size clamp.

255.875 matches the hardware documentation.  Presumably this was a typo.

Found by inspection.  Not known to fix any issues.

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

---

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

diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c 
b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index 06ed89f..50a5ad3 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -209,7 +209,7 @@ upload_sf_state(struct brw_context *brw)
 ctx-Point._Attenuated))
   dw4 |= GEN6_SF_USE_STATE_POINT_WIDTH;
 
-   dw4 |= U_FIXED(CLAMP(ctx-Point.Size, 0.125, 225.875), 3) 
+   dw4 |= U_FIXED(CLAMP(ctx-Point.Size, 0.125, 255.875), 3) 
   GEN6_SF_POINT_WIDTH_SHIFT;
if (ctx-Point.SpriteOrigin == GL_LOWER_LEFT)
   dw1 |= GEN6_SF_POINT_SPRITE_LOWERLEFT;

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


Mesa (master): i965/fs: Refactor control flow stack handling.

2011-02-22 Thread Kenneth Graunke
Module: Mesa
Branch: master
Commit: df2aef0e197f9276f60a8e755260420c90841269
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=df2aef0e197f9276f60a8e755260420c90841269

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sat Feb 19 16:12:28 2011 -0800

i965/fs: Refactor control flow stack handling.

We can't safely use fixed size arrays since Gen6+ supports unlimited
nesting of control flow.

NOTE: This is a candidate for the 7.10 branch.

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

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   34 +++---
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index ed973f4..c6c6497 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3410,20 +3410,25 @@ void
 fs_visitor::generate_code()
 {
int last_native_inst = 0;
-   struct brw_instruction *if_stack[16], *loop_stack[16];
-   int if_stack_depth = 0, loop_stack_depth = 0;
-   int if_depth_in_loop[16];
const char *last_annotation_string = NULL;
ir_instruction *last_annotation_ir = NULL;
 
+   int if_stack_array_size = 16;
+   int loop_stack_array_size = 16;
+   int if_stack_depth = 0, loop_stack_depth = 0;
+   brw_instruction **if_stack =
+  rzalloc_array(this-mem_ctx, brw_instruction *, if_stack_array_size);
+   brw_instruction **loop_stack =
+  rzalloc_array(this-mem_ctx, brw_instruction *, loop_stack_array_size);
+   int *if_depth_in_loop =
+  rzalloc_array(this-mem_ctx, int, loop_stack_array_size);
+
+
if (unlikely(INTEL_DEBUG  DEBUG_WM)) {
   printf(Native code for fragment shader %d:\n,
 ctx-Shader.CurrentFragmentProgram-Name);
}
 
-   if_depth_in_loop[loop_stack_depth] = 0;
-
-   memset(if_stack, 0, sizeof(if_stack));
foreach_iter(exec_list_iterator, iter, this-instructions) {
   fs_inst *inst = (fs_inst *)iter.get();
   struct brw_reg src[3], dst;
@@ -3507,7 +3512,6 @@ fs_visitor::generate_code()
 break;
 
   case BRW_OPCODE_IF:
-assert(if_stack_depth  16);
 if (inst-src[0].file != BAD_FILE) {
assert(intel-gen = 6);
if_stack[if_stack_depth] = brw_IF_gen6(p, inst-conditional_mod, 
src[0], src[1]);
@@ -3516,6 +3520,11 @@ fs_visitor::generate_code()
 }
 if_depth_in_loop[loop_stack_depth]++;
 if_stack_depth++;
+if (if_stack_array_size = if_stack_depth) {
+   if_stack_array_size *= 2;
+   if_stack = reralloc(this-mem_ctx, if_stack, brw_instruction *,
+   if_stack_array_size);
+}
 break;
 
   case BRW_OPCODE_ELSE:
@@ -3530,6 +3539,13 @@ fs_visitor::generate_code()
 
   case BRW_OPCODE_DO:
 loop_stack[loop_stack_depth++] = brw_DO(p, BRW_EXECUTE_8);
+if (loop_stack_array_size = loop_stack_depth) {
+   loop_stack_array_size *= 2;
+   loop_stack = reralloc(this-mem_ctx, loop_stack, brw_instruction *,
+ loop_stack_array_size);
+   if_depth_in_loop = reralloc(this-mem_ctx, if_depth_in_loop, int,
+   loop_stack_array_size);
+}
 if_depth_in_loop[loop_stack_depth] = 0;
 break;
 
@@ -3648,6 +3664,10 @@ fs_visitor::generate_code()
   last_native_inst = p-nr_insn;
}
 
+   ralloc_free(if_stack);
+   ralloc_free(loop_stack);
+   ralloc_free(if_depth_in_loop);
+
brw_set_uip_jip(p);
 
/* OK, while the INTEL_DEBUG=wm above is very nice for debugging FS

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


Mesa (master): xlib: pass Display pointer to XMesaGarbageCollect()

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

Author: Andy Skinner andy.skin...@mathworks.com
Date:   Fri Feb 11 07:31:25 2011 -0800

xlib: pass Display pointer to XMesaGarbageCollect()

Fixes an issue when different displays are used on different threads.

Signed-off-by: Brian Paul bri...@vmware.com

---

 src/mesa/drivers/x11/fakeglx.c |8 
 src/mesa/drivers/x11/xm_api.c  |4 ++--
 src/mesa/drivers/x11/xmesa.h   |2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 577e27d..48657b4 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1292,7 +1292,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
 
/* deallocate unused windows/buffers */
 #if 0
-   XMesaGarbageCollect();
+   XMesaGarbageCollect(dpy);
 #endif
 
xmvis = find_glx_visual( dpy, visinfo );
@@ -1533,7 +1533,7 @@ Fake_glXDestroyContext( Display *dpy, GLXContext ctx )
MakeCurrent_PrevDrawBuffer = 0;
MakeCurrent_PrevReadBuffer = 0;
XMesaDestroyContext( glxCtx-xmesaContext );
-   XMesaGarbageCollect();
+   XMesaGarbageCollect(dpy);
free(glxCtx);
 }
 
@@ -2327,7 +2327,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig 
config,
   return 0;
 
/* deallocate unused windows/buffers */
-   XMesaGarbageCollect();
+   XMesaGarbageCollect(dpy);
 
glxCtx-xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx-xmesaContext : NULL);
@@ -2542,7 +2542,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, 
GLXFBConfigSGIX config, int re
   return 0;
 
/* deallocate unused windows/buffers */
-   XMesaGarbageCollect();
+   XMesaGarbageCollect(dpy);
 
glxCtx-xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx-xmesaContext : NULL);
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index cb71b34..aad902d 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -2064,12 +2064,12 @@ void xmesa_destroy_buffers_on_display(XMesaDisplay *dpy)
  * Look for XMesaBuffers whose X window has been destroyed.
  * Deallocate any such XMesaBuffers.
  */
-void XMesaGarbageCollect( void )
+void XMesaGarbageCollect( XMesaDisplay* dpy )
 {
XMesaBuffer b, next;
for (b=XMesaBufferList; b; b=next) {
   next = b-Next;
-  if (b-display  b-frontxrb-drawable  b-type == WINDOW) {
+  if (b-display  b-display == dpy  b-frontxrb-drawable  b-type 
== WINDOW) {
  XSync(b-display, False);
  if (!window_exists( b-display, b-frontxrb-drawable )) {
 /* found a dead window, free the ancillary info */
diff --git a/src/mesa/drivers/x11/xmesa.h b/src/mesa/drivers/x11/xmesa.h
index 98737fa..347394e 100644
--- a/src/mesa/drivers/x11/xmesa.h
+++ b/src/mesa/drivers/x11/xmesa.h
@@ -324,7 +324,7 @@ extern const char *XMesaGetString( XMesaContext c, int name 
);
  *
  * New in Mesa 2.3.
  */
-extern void XMesaGarbageCollect( void );
+extern void XMesaGarbageCollect( XMesaDisplay* dpy );
 
 
 

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


Mesa (master): i915g: remove extra semicolons

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 12:44:10 2011 -0700

i915g: remove extra semicolons

---

 src/gallium/drivers/i915/i915_debug.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_debug.c 
b/src/gallium/drivers/i915/i915_debug.c
index e0ea025..1713bf1 100644
--- a/src/gallium/drivers/i915/i915_debug.c
+++ b/src/gallium/drivers/i915/i915_debug.c
@@ -48,9 +48,9 @@ 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);
-DEBUG_GET_ONCE_BOOL_OPTION(i915_lie, I915_LIE, FALSE);
+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)
 {

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


Mesa (master): r300g: fix missing initializers warning

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 12:44:42 2011 -0700

r300g: fix missing initializers warning

---

 src/gallium/drivers/r300/r300_context.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c 
b/src/gallium/drivers/r300/r300_context.c
index da6b0bb..9f85bd4 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -482,7 +482,8 @@ struct pipe_context* r300_create_context(struct 
pipe_screen* screen,
 }
 
 {
-struct pipe_resource vb = {};
+struct pipe_resource vb;
+memset(vb, 0, sizeof(vb));
 vb.target = PIPE_BUFFER;
 vb.format = PIPE_FORMAT_R8_UNORM;
 vb.bind = PIPE_BIND_VERTEX_BUFFER;
@@ -495,7 +496,8 @@ struct pipe_context* r300_create_context(struct 
pipe_screen* screen,
 }
 
 {
-struct pipe_depth_stencil_alpha_state dsa = {};
+struct pipe_depth_stencil_alpha_state dsa;
+memset(dsa, 0, sizeof(dsa));
 dsa.depth.writemask = 1;
 
 r300-dsa_decompress_zmask =

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


Mesa (7.9): radeon/r200: fix fbo-clearmipmap + gen-teximage

2011-02-22 Thread Alex Deucher
Module: Mesa
Branch: 7.9
Commit: 87a02b952be752cb8473066b0f1e3c01b7bc1850
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=87a02b952be752cb8473066b0f1e3c01b7bc1850

Author: Dave Airlie airl...@redhat.com
Date:   Wed Jan 19 10:39:32 2011 +1000

radeon/r200: fix fbo-clearmipmap + gen-teximage

sw clears were being used and not getting the correct offsets in the span
code.

also not emitting correct offsets for CB draws to texture levels.

(I've no idea why I'm playing with r100).

This is a candidate for 7.9 and 7.10

---

 src/mesa/drivers/dri/r200/r200_state_init.c |2 +-
 src/mesa/drivers/dri/radeon/radeon_span.c   |8 
 src/mesa/drivers/dri/radeon/radeon_state_init.c |2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c 
b/src/mesa/drivers/dri/r200/r200_state_init.c
index 1606553..4b6c554 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -587,7 +587,7 @@ static void ctx_emit_cs(GLcontext *ctx, struct 
radeon_state_atom *atom)
 
if (rrb) {
  OUT_BATCH(CP_PACKET0(RADEON_RB3D_COLOROFFSET, 0));
- OUT_BATCH_RELOC(0, rrb-bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+ OUT_BATCH_RELOC(rrb-draw_offset, rrb-bo, rrb-draw_offset, 0, 
RADEON_GEM_DOMAIN_VRAM, 0);
 
  OUT_BATCH(CP_PACKET0(RADEON_RB3D_COLORPITCH, 0));
  OUT_BATCH_RELOC(cbpitch, rrb-bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0);
diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c 
b/src/mesa/drivers/dri/radeon/radeon_span.c
index 9dfe2dd..c59ac16 100644
--- a/src/mesa/drivers/dri/radeon/radeon_span.c
+++ b/src/mesa/drivers/dri/radeon/radeon_span.c
@@ -60,7 +60,7 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer 
*rrb);
 static GLubyte *r200_depth_2byte(const struct radeon_renderbuffer * rrb,
 GLint x, GLint y)
 {
-GLubyte *ptr = rrb-bo-ptr;
+GLubyte *ptr = rrb-bo-ptr + rrb-draw_offset;
 GLint offset;
 if (rrb-has_surface) {
offset = x * rrb-cpp + y * rrb-pitch;
@@ -85,7 +85,7 @@ static GLubyte *r200_depth_2byte(const struct 
radeon_renderbuffer * rrb,
 static GLubyte *r200_depth_4byte(const struct radeon_renderbuffer * rrb,
 GLint x, GLint y)
 {
-GLubyte *ptr = rrb-bo-ptr;
+GLubyte *ptr = rrb-bo-ptr + rrb-draw_offset;
 GLint offset;
 if (rrb-has_surface) {
offset = x * rrb-cpp + y * rrb-pitch;
@@ -439,7 +439,7 @@ static GLubyte *r600_ptr_color(const struct 
radeon_renderbuffer * rrb,
 static GLubyte *radeon_ptr_4byte(const struct radeon_renderbuffer * rrb,
 GLint x, GLint y)
 {
-GLubyte *ptr = rrb-bo-ptr;
+GLubyte *ptr = rrb-bo-ptr + rrb-draw_offset;
 uint32_t mask = RADEON_BO_FLAGS_MACRO_TILE | RADEON_BO_FLAGS_MICRO_TILE;
 GLint offset;
 
@@ -479,7 +479,7 @@ static GLubyte *radeon_ptr_4byte(const struct 
radeon_renderbuffer * rrb,
 static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb,
 GLint x, GLint y)
 {
-GLubyte *ptr = rrb-bo-ptr;
+GLubyte *ptr = rrb-bo-ptr + rrb-draw_offset;
 uint32_t mask = RADEON_BO_FLAGS_MACRO_TILE | RADEON_BO_FLAGS_MICRO_TILE;
 GLint offset;
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c 
b/src/mesa/drivers/dri/radeon/radeon_state_init.c
index 91718a4..1abc847 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state_init.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c
@@ -488,7 +488,7 @@ static void ctx_emit_cs(GLcontext *ctx, struct 
radeon_state_atom *atom)
 
if (rrb) {
  OUT_BATCH(CP_PACKET0(RADEON_RB3D_COLOROFFSET, 0));
- OUT_BATCH_RELOC(0, rrb-bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+ OUT_BATCH_RELOC(rrb-draw_offset, rrb-bo, rrb-draw_offset, 0, 
RADEON_GEM_DOMAIN_VRAM, 0);
 
  OUT_BATCH(CP_PACKET0(RADEON_RB3D_COLORPITCH, 0));
  OUT_BATCH_RELOC(cbpitch, rrb-bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0);

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


Mesa (7.9): radeon: avoid segfault on 3D textures.

2011-02-22 Thread Alex Deucher
Module: Mesa
Branch: 7.9
Commit: b093c9939e31c673d787f0c4215089c9295e50bf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b093c9939e31c673d787f0c4215089c9295e50bf

Author: Dave Airlie airl...@redhat.com
Date:   Wed Jan 19 16:27:13 2011 +1000

radeon: avoid segfault on 3D textures.

This is a candidate for 7.9 and 7.10

---

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

diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c 
b/src/mesa/drivers/dri/radeon/radeon_state.c
index 539b067..8e62290 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -2091,6 +2091,9 @@ static GLboolean r100ValidateBuffers(GLcontext *ctx)
 continue;
 
   t = rmesa-state.texture.unit[i].texobj;
+
+  if (!t)
+continue;
   if (t-image_override  t-bo)
radeon_cs_space_add_persistent_bo(rmesa-radeon.cmdbuf.cs, t-bo,
   RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);

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


Mesa (7.9): dri_util: fail driCreateNewScreen if InitScreen is NULL

2011-02-22 Thread Alex Deucher
Module: Mesa
Branch: 7.9
Commit: 4996e4a845340cc37e24ecb808106cf5246f55aa
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4996e4a845340cc37e24ecb808106cf5246f55aa

Author: Paulo Zanoni pzan...@mandriva.com
Date:   Thu Jan 13 04:59:12 2011 -0800

dri_util: fail driCreateNewScreen if InitScreen is NULL

Without this, X doesn't start with UMS on r300g.

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

Signed-off-by: Paulo Zanoni pzan...@mandriva.com
Signed-off-by: Brian Paul bri...@vmware.com

---

 src/mesa/drivers/dri/common/dri_util.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index d46f622..c66dc9b 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -791,6 +791,9 @@ driCreateNewScreen(int scrn,
 static const __DRIextension *emptyExtensionList[] = { NULL };
 __DRIscreen *psp;
 
+if (driDriverAPI.InitScreen == NULL)
+   return NULL;
+
 psp = calloc(1, sizeof *psp);
 if (!psp)
return NULL;

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


Mesa (7.10): st/mesa: fix a regression from cae2bb76

2011-02-22 Thread Alex Deucher
Module: Mesa
Branch: 7.10
Commit: b847da213ea011da6c96fc67e47fcee5866c1f32
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b847da213ea011da6c96fc67e47fcee5866c1f32

Author: Fredrik Höglund fred...@kde.org
Date:   Thu Jan  6 23:12:08 2011 +0100

st/mesa: fix a regression from cae2bb76

stObj-pt is null when a TFP texture is passed to st_finalize_texture,
and with the changes introduced in the above commit this resulted in a
new texture being created and the existing image being copied into it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Alex Deucher alexdeuc...@gmail.com

---

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

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index 14d33f7..09a10ba 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1858,9 +1858,8 @@ st_finalize_texture(struct gl_context *ctx,
 * will match.
 */
if (firstImage-pt 
-   stObj-pt 
firstImage-pt != stObj-pt 
-   firstImage-pt-last_level = stObj-pt-last_level) {
+   (!stObj-pt || firstImage-pt-last_level = stObj-pt-last_level)) {
   pipe_resource_reference(stObj-pt, firstImage-pt);
   pipe_sampler_view_reference(stObj-sampler_view, NULL);
}

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


Mesa (7.10): dri_util: fail driCreateNewScreen if InitScreen is NULL

2011-02-22 Thread Alex Deucher
Module: Mesa
Branch: 7.10
Commit: f0fa040d947742e6ba9cbde486044e7881323784
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0fa040d947742e6ba9cbde486044e7881323784

Author: Paulo Zanoni pzan...@mandriva.com
Date:   Thu Jan 13 04:59:12 2011 -0800

dri_util: fail driCreateNewScreen if InitScreen is NULL

Without this, X doesn't start with UMS on r300g.

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

Signed-off-by: Paulo Zanoni pzan...@mandriva.com
Signed-off-by: Brian Paul bri...@vmware.com

---

 src/mesa/drivers/dri/common/dri_util.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index a5b71bd..bf8cf6e 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -790,6 +790,9 @@ driCreateNewScreen(int scrn,
 static const __DRIextension *emptyExtensionList[] = { NULL };
 __DRIscreen *psp;
 
+if (driDriverAPI.InitScreen == NULL)
+   return NULL;
+
 psp = calloc(1, sizeof *psp);
 if (!psp)
return NULL;

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


Mesa (7.10): radeon: calculate complete texture state inside TFP function

2011-02-22 Thread Alex Deucher
Module: Mesa
Branch: 7.10
Commit: d3d2be2de1249fab2916bcc47566fd8ad271038e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d3d2be2de1249fab2916bcc47566fd8ad271038e

Author: Dave Airlie airl...@redhat.com
Date:   Wed Jan 19 15:27:54 2011 +1000

radeon: calculate complete texture state inside TFP function

(really not sure why I'm doing this).

This is a candidate for 7.9 and 7.10 branches.

---

 src/mesa/drivers/dri/radeon/radeon_texstate.c |   28 ++--
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c 
b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 32c021c..e972a67 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -639,6 +639,21 @@ void radeonSetTexOffset(__DRIcontext * pDRICtx, GLint 
texname,
}
 }
 
+static int
+logbase2(int n)
+{
+   GLint i = 1;
+   GLint log2 = 0;
+
+   while (n  i) {
+  i *= 2;
+  log2++;
+   }
+
+   return log2;
+}
+
+
 void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint 
texture_format,
 __DRIdrawable *dPriv)
 {
@@ -652,12 +667,11 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint 
target, GLint texture_form
struct radeon_framebuffer *rfb;
radeonTexObjPtr t;
uint32_t pitch_val;
-   uint32_t internalFormat, type, format;
+   uint32_t internalFormat, format;
gl_format texFormat;
 
-   type = GL_BGRA;
format = GL_UNSIGNED_BYTE;
-   internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? 3 : 4);
+   internalFormat = (texture_format == __DRI_TEXTURE_FORMAT_RGB ? GL_RGB : 
GL_RGBA);
 
radeon = pDRICtx-driverPrivate;
rmesa = pDRICtx-driverPrivate;
@@ -739,6 +753,14 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint 
target, GLint texture_form
t-pp_txformat |= RADEON_TXFORMAT_NON_POWER2;
t-pp_txpitch = pitch_val;
t-pp_txpitch -= 32;
+   } else {
+ t-pp_txformat = ~(RADEON_TXFORMAT_WIDTH_MASK |
+ RADEON_TXFORMAT_HEIGHT_MASK |
+ RADEON_TXFORMAT_CUBIC_MAP_ENABLE |
+ RADEON_TXFORMAT_F5_WIDTH_MASK |
+ RADEON_TXFORMAT_F5_HEIGHT_MASK);
+ t-pp_txformat |= ((texImage-WidthLog2  
RADEON_TXFORMAT_WIDTH_SHIFT) |
+(texImage-HeightLog2  
RADEON_TXFORMAT_HEIGHT_SHIFT));
}
t-validated = GL_TRUE;
_mesa_unlock_texture(radeon-glCtx, texObj);

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


Mesa (7.10): radeon: avoid segfault on 3D textures.

2011-02-22 Thread Alex Deucher
Module: Mesa
Branch: 7.10
Commit: 76366ee06b03c5eff259c2b4fdbb62c3c2638dd8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=76366ee06b03c5eff259c2b4fdbb62c3c2638dd8

Author: Dave Airlie airl...@redhat.com
Date:   Wed Jan 19 16:27:13 2011 +1000

radeon: avoid segfault on 3D textures.

This is a candidate for 7.9 and 7.10

---

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

diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c 
b/src/mesa/drivers/dri/radeon/radeon_state.c
index cae12f1..51e4b8f 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -2091,6 +2091,9 @@ static GLboolean r100ValidateBuffers(struct gl_context 
*ctx)
 continue;
 
   t = rmesa-state.texture.unit[i].texobj;
+
+  if (!t)
+continue;
   if (t-image_override  t-bo)
radeon_cs_space_add_persistent_bo(rmesa-radeon.cmdbuf.cs, t-bo,
   RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);

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


Mesa (master): vbo: use ctx intstead of exec-ctx

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 13:24:56 2011 -0700

vbo: use ctx intstead of exec-ctx

---

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

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index c4d39d8..8dcbc8b 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -378,7 +378,7 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr, 
GLuint newSize)
 * afterwards).
 */
if (attr == 0) 
-  exec-ctx-Driver.NeedFlush |= FLUSH_STORED_VERTICES;
+  ctx-Driver.NeedFlush |= FLUSH_STORED_VERTICES;
 }
 
 
@@ -862,7 +862,7 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec )
 
/* Hook our functions into the dispatch table.
 */
-   _mesa_install_exec_vtxfmt( exec-ctx, exec-vtxfmt );
+   _mesa_install_exec_vtxfmt( ctx, exec-vtxfmt );
 
for (i = 0 ; i  VBO_ATTRIB_MAX ; i++) {
   ASSERT(i  Elements(exec-vtx.attrsz));
@@ -941,8 +941,8 @@ void vbo_exec_BeginVertices( struct gl_context *ctx )
 
vbo_exec_vtx_map( exec );
 
-   assert((exec-ctx-Driver.NeedFlush  FLUSH_UPDATE_CURRENT) == 0);
-   exec-ctx-Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
+   assert((ctx-Driver.NeedFlush  FLUSH_UPDATE_CURRENT) == 0);
+   ctx-Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
 }
 
 
@@ -960,7 +960,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, GLuint 
flags )
assert(exec-flush_call_depth == 1);
 #endif
 
-   if (exec-ctx-Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
+   if (ctx-Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
   /* We've had glBegin but not glEnd! */
 #ifdef DEBUG
   exec-flush_call_depth--;
@@ -974,10 +974,10 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, 
GLuint flags )
 
/* Need to do this to ensure BeginVertices gets called again:
 */
-   if (exec-ctx-Driver.NeedFlush  FLUSH_UPDATE_CURRENT)
-  exec-ctx-Driver.NeedFlush = ~FLUSH_UPDATE_CURRENT;
+   if (ctx-Driver.NeedFlush  FLUSH_UPDATE_CURRENT)
+  ctx-Driver.NeedFlush = ~FLUSH_UPDATE_CURRENT;
 
-   exec-ctx-Driver.NeedFlush = ~flags;
+   ctx-Driver.NeedFlush = ~flags;
 
 #ifdef DEBUG
exec-flush_call_depth--;

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


Mesa (master): vbo: simplify NeedFlush flag clearing

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 13:31:09 2011 -0700

vbo: simplify NeedFlush flag clearing

---

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

diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 8dcbc8b..2f9f3ec 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -974,10 +974,7 @@ void vbo_exec_FlushVertices( struct gl_context *ctx, 
GLuint flags )
 
/* Need to do this to ensure BeginVertices gets called again:
 */
-   if (ctx-Driver.NeedFlush  FLUSH_UPDATE_CURRENT)
-  ctx-Driver.NeedFlush = ~FLUSH_UPDATE_CURRENT;
-
-   ctx-Driver.NeedFlush = ~flags;
+   ctx-Driver.NeedFlush = ~(FLUSH_UPDATE_CURRENT | flags);
 
 #ifdef DEBUG
exec-flush_call_depth--;

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


Mesa (master): mesa: move comment, change debug code

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 13:37:30 2011 -0700

mesa: move comment, change debug code

---

 src/mesa/main/dlist.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index cdf3491..8e904c7 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -8419,8 +8419,6 @@ _mesa_CallList(GLuint list)
GLboolean save_compile_flag;
GET_CURRENT_CONTEXT(ctx);
FLUSH_CURRENT(ctx, 0);
-   /* VERY IMPORTANT:  Save the CompileFlag status, turn it off, */
-   /* execute the display list, and restore the CompileFlag. */
 
if (MESA_VERBOSE  VERBOSE_API)
   _mesa_debug(ctx, glCallList %d\n, list);
@@ -8430,8 +8428,12 @@ _mesa_CallList(GLuint list)
   return;
}
 
-/* mesa_print_display_list( list ); */
+   if (0)
+  mesa_print_display_list( list );
 
+   /* VERY IMPORTANT:  Save the CompileFlag status, turn it off,
+* execute the display list, and restore the CompileFlag.
+*/
save_compile_flag = ctx-CompileFlag;
if (save_compile_flag) {
   ctx-CompileFlag = GL_FALSE;

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


Mesa (master): vbo: removed unused #defines, add comments

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 14:23:50 2011 -0700

vbo: removed unused #defines, add comments

---

 src/mesa/vbo/vbo_exec.h |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index ca100e4..1b0ed79 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -40,13 +40,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include vbo_attrib.h
 
 
+/**
+ * Max number of primitives (number of glBegin/End pairs) per VBO.
+ */
 #define VBO_MAX_PRIM 64
 
-/* Wierd implementation stuff:
+
+/**
+ * Size of the VBO to use for glBegin/glVertex/glEnd-style rendering.
  */
 #define VBO_VERT_BUFFER_SIZE (1024*64) /* bytes */
-#define VBO_MAX_ATTR_CODEGEN 16 
-#define ERROR_ATTRIB 16
 
 
 /** Current vertex program mode */

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


Mesa (master): vbo: added vbo_check_buffers_are_unmapped() debug function

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

Author: Brian Paul bri...@vmware.com
Date:   Tue Feb 22 14:31:15 2011 -0700

vbo: added vbo_check_buffers_are_unmapped() debug function

---

 src/mesa/vbo/vbo.h|2 ++
 src/mesa/vbo/vbo_exec_array.c |   17 +
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 37940ef..6834f3b 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -130,6 +130,8 @@ void vbo_use_buffer_objects(struct gl_context *ctx);
 
 void vbo_set_draw_func(struct gl_context *ctx, vbo_draw_func func);
 
+void vbo_check_buffers_are_unmapped(struct gl_context *ctx);
+
 
 void GLAPIENTRY
 _es_Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 25de140..457343a 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -59,6 +59,23 @@ check_buffers_are_unmapped(const struct gl_client_array 
**inputs)
 
 
 /**
+ * A debug function that may be called from other parts of Mesa as
+ * needed during debugging.
+ */
+void
+vbo_check_buffers_are_unmapped(struct gl_context *ctx)
+{
+   struct vbo_context *vbo = vbo_context(ctx);
+   struct vbo_exec_context *exec = vbo-exec;
+   /* check the current vertex arrays */
+   check_buffers_are_unmapped(exec-array.inputs);
+   /* check the current glBegin/glVertex/glEnd-style VBO */
+   assert(!_mesa_bufferobj_mapped(exec-vtx.bufferobj));
+}
+
+
+
+/**
  * Compute min and max elements by scanning the index buffer for
  * glDraw[Range]Elements() calls.
  * If primitive restart is enabled, we need to ignore restart

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