Re: [Mesa-dev] [PATCH] mesa: move ElementArrayBufferObj to gl_array_object

2011-11-28 Thread Yuanhan Liu
On Sat, Nov 26, 2011 at 09:01:51AM -0700, Brian Paul wrote:
 On 11/23/2011 06:15 PM, Yuanhan Liu wrote:
 On Wed, Nov 23, 2011 at 08:25:59AM -0700, Brian Paul wrote:
 On 11/23/2011 02:26 AM, Yuanhan Liu wrote:
 According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
 page 515, the element buffer object is listed in vertex array object.
 
 So, move the ElementArrayBufferObj inside gl_array_object to make
 element buffer object per-vao.
 
 This would fix most of(3 left) intel oglc vao test fail
 
 Signed-off-by: Yuanhan Liuyuanhan@linux.intel.com
 ---
   src/mesa/main/api_arrayelt.c  |2 +-
   src/mesa/main/api_validate.c  |   14 ++--
   src/mesa/main/arrayobj.c  |4 +++
   src/mesa/main/attrib.c|7 ++---
   src/mesa/main/bufferobj.c |9 ++-
   src/mesa/main/context.c   |1 -
   src/mesa/main/get.c   |2 +-
   src/mesa/main/mtypes.h|3 +-
   src/mesa/vbo/vbo_exec_array.c |   42 
  
   src/mesa/vbo/vbo_save_api.c   |4 +-
   10 files changed, 44 insertions(+), 44 deletions(-)
 
 
 I presume you've done a piglit run to check for regressions.
 
 Nope. But I did test this patch with all intel oglc testcases, and
 with no regression. Is this OK?
 
 You should probably find and run the piglit tests that use
 GL_ELEMENT_ARRAY_BUFFER, at least.

Done and found no piglit regression. Can I push it? If no objection, I
will push it tomorrow.

Thanks,
Yuanhan Liu
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: move ElementArrayBufferObj to gl_array_object

2011-11-28 Thread Brian Paul

On 11/28/2011 01:50 AM, Yuanhan Liu wrote:

On Sat, Nov 26, 2011 at 09:01:51AM -0700, Brian Paul wrote:

On 11/23/2011 06:15 PM, Yuanhan Liu wrote:

On Wed, Nov 23, 2011 at 08:25:59AM -0700, Brian Paul wrote:

On 11/23/2011 02:26 AM, Yuanhan Liu wrote:

According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

Signed-off-by: Yuanhan Liuyuanhan@linux.intel.com
---
  src/mesa/main/api_arrayelt.c  |2 +-
  src/mesa/main/api_validate.c  |   14 ++--
  src/mesa/main/arrayobj.c  |4 +++
  src/mesa/main/attrib.c|7 ++---
  src/mesa/main/bufferobj.c |9 ++-
  src/mesa/main/context.c   |1 -
  src/mesa/main/get.c   |2 +-
  src/mesa/main/mtypes.h|3 +-
  src/mesa/vbo/vbo_exec_array.c |   42 
  src/mesa/vbo/vbo_save_api.c   |4 +-
  10 files changed, 44 insertions(+), 44 deletions(-)



I presume you've done a piglit run to check for regressions.


Nope. But I did test this patch with all intel oglc testcases, and
with no regression. Is this OK?


You should probably find and run the piglit tests that use
GL_ELEMENT_ARRAY_BUFFER, at least.


Done and found no piglit regression. Can I push it? If no objection, I
will push it tomorrow.


I think you can push this.

-Brian

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


Re: [Mesa-dev] [PATCH] mesa: move ElementArrayBufferObj to gl_array_object

2011-11-26 Thread Brian Paul

On 11/23/2011 06:15 PM, Yuanhan Liu wrote:

On Wed, Nov 23, 2011 at 08:25:59AM -0700, Brian Paul wrote:

On 11/23/2011 02:26 AM, Yuanhan Liu wrote:

According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

Signed-off-by: Yuanhan Liuyuanhan@linux.intel.com
---
  src/mesa/main/api_arrayelt.c  |2 +-
  src/mesa/main/api_validate.c  |   14 ++--
  src/mesa/main/arrayobj.c  |4 +++
  src/mesa/main/attrib.c|7 ++---
  src/mesa/main/bufferobj.c |9 ++-
  src/mesa/main/context.c   |1 -
  src/mesa/main/get.c   |2 +-
  src/mesa/main/mtypes.h|3 +-
  src/mesa/vbo/vbo_exec_array.c |   42 
  src/mesa/vbo/vbo_save_api.c   |4 +-
  10 files changed, 44 insertions(+), 44 deletions(-)



I presume you've done a piglit run to check for regressions.


Nope. But I did test this patch with all intel oglc testcases, and
with no regression. Is this OK?


You should probably find and run the piglit tests that use 
GL_ELEMENT_ARRAY_BUFFER, at least.


-Brian

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


[Mesa-dev] [PATCH] mesa: move ElementArrayBufferObj to gl_array_object

2011-11-23 Thread Yuanhan Liu
According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

Signed-off-by: Yuanhan Liu yuanhan@linux.intel.com
---
 src/mesa/main/api_arrayelt.c  |2 +-
 src/mesa/main/api_validate.c  |   14 ++--
 src/mesa/main/arrayobj.c  |4 +++
 src/mesa/main/attrib.c|7 ++---
 src/mesa/main/bufferobj.c |9 ++-
 src/mesa/main/context.c   |1 -
 src/mesa/main/get.c   |2 +-
 src/mesa/main/mtypes.h|3 +-
 src/mesa/vbo/vbo_exec_array.c |   42 
 src/mesa/vbo/vbo_save_api.c   |4 +-
 10 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index b93a057..4d9ff43 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -1580,7 +1580,7 @@ static void _ae_update_state( struct gl_context *ctx )
   aa++;
}
 
-   check_vbo(actx, ctx-Array.ElementArrayBufferObj);
+   check_vbo(actx, arrayObj-ElementArrayBufferObj);
 
ASSERT(at - actx-attribs = VERT_ATTRIB_MAX);
ASSERT(aa - actx-arrays  32);
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 1fcf5cd..4c7baca 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -182,7 +182,7 @@ check_index_bounds(struct gl_context *ctx, GLsizei count, 
GLenum type,
memset(ib, 0, sizeof(ib));
ib.type = type;
ib.ptr = indices;
-   ib.obj = ctx-Array.ElementArrayBufferObj;
+   ib.obj = ctx-Array.ArrayObj-ElementArrayBufferObj;
 
vbo_get_minmax_index(ctx, prim, ib, min, max);
 
@@ -254,10 +254,10 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
   return GL_FALSE;
 
/* Vertex buffer object tests */
-   if (_mesa_is_bufferobj(ctx-Array.ElementArrayBufferObj)) {
+   if (_mesa_is_bufferobj(ctx-Array.ArrayObj-ElementArrayBufferObj)) {
   /* use indices in the buffer object */
   /* make sure count doesn't go outside buffer bounds */
-  if (index_bytes(type, count)  ctx-Array.ElementArrayBufferObj-Size) {
+  if (index_bytes(type, count)  
ctx-Array.ArrayObj-ElementArrayBufferObj-Size) {
  _mesa_warning(ctx, glDrawElements index out of buffer bounds);
  return GL_FALSE;
   }
@@ -315,10 +315,10 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, 
GLenum mode,
   return GL_FALSE;
 
/* Vertex buffer object tests */
-   if (_mesa_is_bufferobj(ctx-Array.ElementArrayBufferObj)) {
+   if (_mesa_is_bufferobj(ctx-Array.ArrayObj-ElementArrayBufferObj)) {
   /* use indices in the buffer object */
   /* make sure count doesn't go outside buffer bounds */
-  if (index_bytes(type, count)  ctx-Array.ElementArrayBufferObj-Size) {
+  if (index_bytes(type, count)  
ctx-Array.ArrayObj-ElementArrayBufferObj-Size) {
  _mesa_warning(ctx, glDrawRangeElements index out of buffer bounds);
  return GL_FALSE;
   }
@@ -454,10 +454,10 @@ _mesa_validate_DrawElementsInstanced(struct gl_context 
*ctx,
   return GL_FALSE;
 
/* Vertex buffer object tests */
-   if (_mesa_is_bufferobj(ctx-Array.ElementArrayBufferObj)) {
+   if (_mesa_is_bufferobj(ctx-Array.ArrayObj-ElementArrayBufferObj)) {
   /* use indices in the buffer object */
   /* make sure count doesn't go outside buffer bounds */
-  if (index_bytes(type, count)  ctx-Array.ElementArrayBufferObj-Size) {
+  if (index_bytes(type, count)  
ctx-Array.ArrayObj-ElementArrayBufferObj-Size) {
  _mesa_warning(ctx,
glDrawElementsInstanced index out of buffer bounds);
  return GL_FALSE;
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 1283940..a0c9b11 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -133,6 +133,7 @@ _mesa_delete_array_object( struct gl_context *ctx, struct 
gl_array_object *obj )
 {
(void) ctx;
unbind_array_object_vbos(ctx, obj);
+   _mesa_reference_buffer_object(ctx, obj-ElementArrayBufferObj, NULL);
_glthread_DESTROY_MUTEX(obj-Mutex);
free(obj);
 }
@@ -252,6 +253,9 @@ _mesa_initialize_array_object( struct gl_context *ctx,
 #if FEATURE_point_size_array
init_array(ctx, obj-PointSize, 1, GL_FLOAT);
 #endif
+
+   _mesa_reference_buffer_object(ctx, obj-ElementArrayBufferObj,
+ ctx-Shared-NullBufferObj);
 }
 
 
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index f368eec..30297de 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1385,8 +1385,8 @@ save_array_attrib(struct gl_context *ctx,
/* Just reference them here */
_mesa_reference_buffer_object(ctx, dest-ArrayBufferObj,
  src-ArrayBufferObj);
-   

Re: [Mesa-dev] [PATCH] mesa: move ElementArrayBufferObj to gl_array_object

2011-11-23 Thread Brian Paul

On 11/23/2011 02:26 AM, Yuanhan Liu wrote:

According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

Signed-off-by: Yuanhan Liuyuanhan@linux.intel.com
---
  src/mesa/main/api_arrayelt.c  |2 +-
  src/mesa/main/api_validate.c  |   14 ++--
  src/mesa/main/arrayobj.c  |4 +++
  src/mesa/main/attrib.c|7 ++---
  src/mesa/main/bufferobj.c |9 ++-
  src/mesa/main/context.c   |1 -
  src/mesa/main/get.c   |2 +-
  src/mesa/main/mtypes.h|3 +-
  src/mesa/vbo/vbo_exec_array.c |   42 
  src/mesa/vbo/vbo_save_api.c   |4 +-
  10 files changed, 44 insertions(+), 44 deletions(-)



I presume you've done a piglit run to check for regressions.

Otherwise, looks good to me.  Thanks for finding this mistake and 
fixing it!


I think this should be noted as a candidate for the 7.11 branch.

Reviewed-by: Brian Paul bri...@vmware.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev