Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-12 Thread Brian Paul

On 11/11/2013 04:57 PM, Petr Sebor wrote:

Not having push access rights, I hope this fix gets merged soon.
Hopefully a stable release candidate as well.


I'll do so in a bit.  I'll tag it for the 9.2 and 10.0 branches too.

-Brian


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


[Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Petr Sebor
Otherwise, the function would enable generic vertex attributes 0 and 1 of the
array object it does not own. This was causing crashes in Euro Truck Simulator 
2,
since the incorrectly enabled generic attribute 0 in the foreign context got
precedence before vertex position attribute at later time, leading to NULL
pointer dereference.

Signed-off-by: Petr Sebor p...@scssoft.com
---
This version is really much better for the reasons both you and Ian mentioned.
And... works for me! Thanks!

Petr
---
 src/mesa/drivers/common/meta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index f818416..3be 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1515,6 +1515,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
sizeof(struct vertex), OFFSET(x));
   _mesa_VertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE,
sizeof(struct vertex), OFFSET(s));
+
+  _mesa_EnableVertexAttribArray(0);
+  _mesa_EnableVertexAttribArray(1);
}
 
/* Generate a relevant fragment shader program for the texture target */
@@ -1591,8 +1594,6 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
_mesa_DeleteObjectARB(vs);
_mesa_BindAttribLocation(ShaderProg, 0, position);
_mesa_BindAttribLocation(ShaderProg, 1, texcoords);
-   _mesa_EnableVertexAttribArray(0);
-   _mesa_EnableVertexAttribArray(1);
link_program_with_debug(ctx, ShaderProg);
ralloc_free(mem_ctx);
if (texture_2d)
-- 
1.8.3.2

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


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Brian Paul

On 11/11/2013 04:19 PM, Petr Sebor wrote:

Otherwise, the function would enable generic vertex attributes 0 and 1 of the
array object it does not own. This was causing crashes in Euro Truck Simulator 
2,
since the incorrectly enabled generic attribute 0 in the foreign context got
precedence before vertex position attribute at later time, leading to NULL
pointer dereference.

Signed-off-by: Petr Sebor p...@scssoft.com


Reviewed-by: Brian Paul bri...@vmware.com

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


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Ian Romanick
On 11/11/2013 03:19 PM, Petr Sebor wrote:
 Otherwise, the function would enable generic vertex attributes 0 and 1 of the
 array object it does not own. This was causing crashes in Euro Truck 
 Simulator 2,
 since the incorrectly enabled generic attribute 0 in the foreign context got
 precedence before vertex position attribute at later time, leading to NULL
 pointer dereference.
 
 Signed-off-by: Petr Sebor p...@scssoft.com

Looks good to me.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com

 ---
 This version is really much better for the reasons both you and Ian mentioned.
 And... works for me! Thanks!
 
 Petr
 ---
  src/mesa/drivers/common/meta.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
 index f818416..3be 100644
 --- a/src/mesa/drivers/common/meta.c
 +++ b/src/mesa/drivers/common/meta.c
 @@ -1515,6 +1515,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
 sizeof(struct vertex), OFFSET(x));
_mesa_VertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE,
 sizeof(struct vertex), OFFSET(s));
 +
 +  _mesa_EnableVertexAttribArray(0);
 +  _mesa_EnableVertexAttribArray(1);
 }
  
 /* Generate a relevant fragment shader program for the texture target */
 @@ -1591,8 +1594,6 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
 _mesa_DeleteObjectARB(vs);
 _mesa_BindAttribLocation(ShaderProg, 0, position);
 _mesa_BindAttribLocation(ShaderProg, 1, texcoords);
 -   _mesa_EnableVertexAttribArray(0);
 -   _mesa_EnableVertexAttribArray(1);
 link_program_with_debug(ctx, ShaderProg);
 ralloc_free(mem_ctx);
 if (texture_2d)
 

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


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Petr Sebor

Not having push access rights, I hope this fix gets merged soon.
Hopefully a stable release candidate as well.

Thanks,
Petr

On 12.11.2013 00:32, Brian Paul wrote:

On 11/11/2013 04:19 PM, Petr Sebor wrote:
Otherwise, the function would enable generic vertex attributes 0 and 
1 of the
array object it does not own. This was causing crashes in Euro Truck 
Simulator 2,
since the incorrectly enabled generic attribute 0 in the foreign 
context got
precedence before vertex position attribute at later time, leading to 
NULL

pointer dereference.

Signed-off-by: Petr Sebor p...@scssoft.com


Reviewed-by: Brian Paul bri...@vmware.com

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


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