Re: [Mesa3d-dev] [PATCH] gallium: only create pipe buffer when size is nonzero

2009-12-23 Thread Maarten Maathuis
Anyone?

On Sun, Dec 20, 2009 at 2:03 PM, Maarten Maathuis madman2...@gmail.com wrote:
 - This fixes a crash upon starting spring (a rts engine/game).

 Signed-off-by: Maarten Maathuis madman2...@gmail.com
 ---
  src/mesa/state_tracker/st_cb_bufferobjects.c |   16 ++--
  1 files changed, 10 insertions(+), 6 deletions(-)

 diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c 
 b/src/mesa/state_tracker/st_cb_bufferobjects.c
 index 63196af..494a3a9 100644
 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c
 +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
 @@ -170,15 +170,19 @@ st_bufferobj_data(GLcontext *ctx,

    pipe_buffer_reference( st_obj-buffer, NULL );

 -   st_obj-buffer = pipe_buffer_create( pipe-screen, 32, buffer_usage, size 
 );
 +   if (size != 0) {
 +      st_obj-buffer = pipe_buffer_create(pipe-screen, 32, buffer_usage, 
 size);

 -   if (!st_obj-buffer) {
 -      return GL_FALSE;
 +      if (!st_obj-buffer) {
 +         return GL_FALSE;
 +      }
 +
 +      if (data)
 +         st_no_flush_pipe_buffer_write(st_context(ctx), st_obj-buffer, 0,
 +                                      size, data);
 +      return GL_TRUE;
    }

 -   if (data)
 -      st_no_flush_pipe_buffer_write(st_context(ctx), st_obj-buffer, 0,
 -                                   size, data);
    return GL_TRUE;
  }

 --
 1.6.5.4



--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] gallium: only create pipe buffer when size is nonzero

2009-12-23 Thread José Fonseca
Maarten,

Looks good to me. Do you need someone to commit it for you?

Jose


On Wed, 2009-12-23 at 07:32 -0800, Maarten Maathuis wrote:
 Anyone?
 
 On Sun, Dec 20, 2009 at 2:03 PM, Maarten Maathuis madman2...@gmail.com 
 wrote:
  - This fixes a crash upon starting spring (a rts engine/game).
 
  Signed-off-by: Maarten Maathuis madman2...@gmail.com
  ---
   src/mesa/state_tracker/st_cb_bufferobjects.c |   16 ++--
   1 files changed, 10 insertions(+), 6 deletions(-)
 
  diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c 
  b/src/mesa/state_tracker/st_cb_bufferobjects.c
  index 63196af..494a3a9 100644
  --- a/src/mesa/state_tracker/st_cb_bufferobjects.c
  +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
  @@ -170,15 +170,19 @@ st_bufferobj_data(GLcontext *ctx,
 
 pipe_buffer_reference( st_obj-buffer, NULL );
 
  -   st_obj-buffer = pipe_buffer_create( pipe-screen, 32, buffer_usage, 
  size );
  +   if (size != 0) {
  +  st_obj-buffer = pipe_buffer_create(pipe-screen, 32, buffer_usage, 
  size);
 
  -   if (!st_obj-buffer) {
  -  return GL_FALSE;
  +  if (!st_obj-buffer) {
  + return GL_FALSE;
  +  }
  +
  +  if (data)
  + st_no_flush_pipe_buffer_write(st_context(ctx), st_obj-buffer, 0,
  +  size, data);
  +  return GL_TRUE;
 }
 
  -   if (data)
  -  st_no_flush_pipe_buffer_write(st_context(ctx), st_obj-buffer, 0,
  -   size, data);
 return GL_TRUE;
   }
 
  --
  1.6.5.4
 
 
 
 --
 This SF.Net email is sponsored by the Verizon Developer Community
 Take advantage of Verizon's best-in-class app development support
 A streamlined, 14 day to market process makes app distribution fast and easy
 Join now and get one step closer to millions of Verizon customers
 http://p.sf.net/sfu/verizon-dev2dev 
 ___
 Mesa3d-dev mailing list
 Mesa3d-dev@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mesa3d-dev



--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] gallium: only create pipe buffer when size is nonzero

2009-12-23 Thread Keith Whitwell
Again I'm doing these by hand through a crappy webmail that won't let me save 
messages.  Hopefully the result isn't too awful.

Keith

From: Maarten Maathuis [madman2...@gmail.com]
Sent: Wednesday, December 23, 2009 7:32 AM
To: mesa3d-dev@lists.sourceforge.net
Subject: Re: [Mesa3d-dev] [PATCH] gallium: only create pipe buffer when size
is nonzero

Anyone?

On Sun, Dec 20, 2009 at 2:03 PM, Maarten Maathuis madman2...@gmail.com wrote:
 - This fixes a crash upon starting spring (a rts engine/game).

 Signed-off-by: Maarten Maathuis madman2...@gmail.com
 ---
  src/mesa/state_tracker/st_cb_bufferobjects.c |   16 ++--
  1 files changed, 10 insertions(+), 6 deletions(-)

 diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c 
 b/src/mesa/state_tracker/st_cb_bufferobjects.c
 index 63196af..494a3a9 100644
 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c
 +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
 @@ -170,15 +170,19 @@ st_bufferobj_data(GLcontext *ctx,

pipe_buffer_reference( st_obj-buffer, NULL );

 -   st_obj-buffer = pipe_buffer_create( pipe-screen, 32, buffer_usage, size 
 );
 +   if (size != 0) {
 +  st_obj-buffer = pipe_buffer_create(pipe-screen, 32, buffer_usage, 
 size);

 -   if (!st_obj-buffer) {
 -  return GL_FALSE;
 +  if (!st_obj-buffer) {
 + return GL_FALSE;
 +  }
 +
 +  if (data)
 + st_no_flush_pipe_buffer_write(st_context(ctx), st_obj-buffer, 0,
 +  size, data);
 +  return GL_TRUE;
}

 -   if (data)
 -  st_no_flush_pipe_buffer_write(st_context(ctx), st_obj-buffer, 0,
 -   size, data);
return GL_TRUE;
  }

 --
 1.6.5.4



--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev