[clutter] Re: patch: Allocate dynamic memory in ClutterValues rather than hardcoding very small numbers
On 15 June 2010 22:52, Richard Hughes hughsi...@gmail.com wrote: I've attached a patch to make the clutter shader types use dynamically allocated memory, which allows me to pass the few kb of data to my fragment shader. Actually, that doesn't work so well, as clutter_shader_set_uniform() uses the 'size' as the vector width, rather than the data size for a 1D float array. Would you guys take a patch to add a size check to the existing functions (with a critical warning perhaps) to avoid blitting random blobs of memory and then for me to write a patch for a ClutterShaderFloatArray GValue type? This would contain the size (width) and the length (number of elements). In related news, creating a ClutterShader object, compiling it, then using cogl_program_use(), then cogl_program_uniform_float(), then assigning it to a ClutterActor, doesn't work so well. I guess it's poking about behind the scenes a little too much. Thanks, Richard. -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
Re: [clutter] patch: Fix build when using make dist
On Tue, 2010-06-15 at 22:37 +0100, Richard Hughes wrote: Error with git master: + make -j2 V=1 ./cogl-material.c:41:32: error: cogl-color-private.h: No such file or directory ./cogl-material.c: In function '_cogl_material_get_colorubv': ./cogl-material.c:3251: warning: implicit declaration of function '_cogl_color_get_rgba_4ubv' Attached patch fixes the issue for me. thanks, applied to master. ciao, Emmanuele. -- Emmanuele Bassi, Open Source Software Engineer Intel Open Source Technology Center -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
[clutter] Migration of clutter-project.org to a new server
hi everyone; for the past 9 months we've been in the process of migrating clutter-project.org to a new server. it seems that finally we're in the final stages of this long transfer. the change will involve: • the main Git server • the website • the project's blog • the Bugzilla installation • the mailing list and its archives everything will be moved under the clutter-project.org domain: source.clutter-project.org - the location for the various tarballs docs.clutter-project.org - the location for the documentation bugzilla.clutter-project.org - the new Bugzilla instance wiki.clutter-project.org - the new wiki git.clutter-project.org - the Git server for cloning repos, and cgit instance for browsing if you have write access to the Git repository, your key will be moved to the new one, so hopefully nothing will be required from you apart from removing git.clutter-project.org from the SSH known hosts; just poke me on IRC or via email if anything ceases to work. the Bugzilla instance at bugzilla.o-hand.com will be frozen, and the bugs moved to the new one. the version is currently the same, but we expect to upgrade to the latest version, and add Splinter for patches review. unfortunately, the mailing list software will be changed from the current one to mailman+listinfo; this means that you'll have to re-subscribe to the new list address. the archives are being collected, and will be available from the new website, as soon as it'll be available. ciao, Emmanuele. -- Emmanuele Bassi, Open Source Software Engineer Intel Open Source Technology Center -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
[clutter] patch: add a safety catch to the ClutterValue shotgun
Please review. Thanks. Richard. From dce6b3a862d34dceb700afee6d7863e26b4f0080 Mon Sep 17 00:00:00 2001 From: Richard Hughes rich...@hughsie.com Date: Wed, 16 Jun 2010 16:19:48 +0100 Subject: [PATCH] Emit a critical error if the user tries to send more data than the static shader GValues can hold This fixes the random memory corruption you get when specifying size 4 --- clutter/clutter-shader-types.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/clutter/clutter-shader-types.c b/clutter/clutter-shader-types.c index 2c35cb8..9ed3998 100644 --- a/clutter/clutter-shader-types.c +++ b/clutter/clutter-shader-types.c @@ -399,6 +399,7 @@ clutter_value_set_shader_float (GValue *value, gint i; g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value)); + g_return_if_fail (size = 4); shader_float = value-data[0].v_pointer; @@ -428,6 +429,7 @@ clutter_value_set_shader_int (GValue *value, gint i; g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_INT (value)); + g_return_if_fail (size = 4); shader_int = value-data[0].v_pointer; @@ -457,6 +459,7 @@ clutter_value_set_shader_matrix (GValue *value, gint i; g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value)); + g_return_if_fail (size = 4); shader_matrix = value-data[0].v_pointer; -- 1.7.1
Re: [clutter] patch: add a safety catch to the ClutterValue shotgun
On Wed, 2010-06-16 at 16:22 +0100, Richard Hughes wrote: Please review. Thanks. looks good. applied to master. ciao, Emmanuele. -- Emmanuele Bassi, Open Source Software Engineer Intel Open Source Technology Center -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
RE: [clutter] Problem migrating from 1.0.10 to 1.2.8
Thanks for the input. I will look into using the patch to fix my font issue. Still have the issue with textures not working. I haven't heard any response on that. Kevin -Original Message- From: Johan Bilien [mailto:j...@via.ecp.fr] Sent: Tuesday, June 15, 2010 7:04 PM To: Kevin Cote Cc: clutter@o-hand.com Subject: Re: [clutter] Problem migrating from 1.0.10 to 1.2.8 Hi, On Mon, Jun 07, 2010, Kevin Cote wrote: I have an application that I have developed over the last 6 months on top of v1.0.10. I am now trying to migrate this app to v1.2.8. I have tried running the migrated app under Ubuntu 9.0.4 and also Moblin v2. I get the same issues in both cases. My symptoms are twofold: - Text is garbled. By this I mean that each character is drawn almost like a block instead of the actual glyph. Porting our app from 0.9 to 1.2 I've had the exact same problem with text (on the infamous GMA500, but also on Intel GM965 when using indirect rendering. I tracked this down to text being rendered with mipmaps, which on GMA500 are either mis-rendered or make the driver crash. Our app was doing clutter_set_font_flags(0); to disable font mipmaps, but that call was a no-op in clutter 1.2 due to this bug: http://bugzilla.openedhand.com/show_bug.cgi?id=2161 Maybe the patch attached to the bug (now in clutter master) would fix your problem, it fixed ours. Johan. --- This email and any files transmitted with it are confidential proprietary to Systems and Software Enterprises, Inc. (dba IMS). This information is intended solely for the use of the individual or entity to which it is addressed. Access or transmittal of the information contained in this e-mail, in full or in part, to any other organization or persons is not authorized. --- -- To unsubscribe send a mail to clutter+unsubscr...@o-hand.com
[clutter] Re: patch: Allocate dynamic memory in ClutterValues rather than hardcoding very small numbers
On 16 June 2010 10:41, Richard Hughes hughsi...@gmail.com wrote: ...This would contain the size Two new patches attached. Careful review please. Richard. From b0b3e8c365e44a2b78aad93e394f55241737588f Mon Sep 17 00:00:00 2001 From: Richard Hughes rich...@hughsie.com Date: Wed, 16 Jun 2010 17:32:14 +0100 Subject: [PATCH 1/2] Allocate memory for the ClutterShaderMatrix so we can support non-square data in the future --- clutter/clutter-shader-types.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clutter/clutter-shader-types.c b/clutter/clutter-shader-types.c index 9ed3998..57bf11c 100644 --- a/clutter/clutter-shader-types.c +++ b/clutter/clutter-shader-types.c @@ -93,8 +93,8 @@ struct _ClutterShaderInt struct _ClutterShaderMatrix { - gintsize; - GLfloat value[16]; + gint size; + GLfloat *value; }; static gpointer @@ -296,7 +296,10 @@ clutter_value_init_shader_matrix (GValue *value) static void clutter_value_free_shader_matrix (GValue *value) { - g_slice_free (ClutterShaderMatrix, value-data[0].v_pointer); + ClutterShaderMatrix *shader_matrix; + shader_matrix = value-data[0].v_pointer; + g_free (shader_matrix-value); + g_slice_free (ClutterShaderMatrix, shader_matrix); } static void @@ -442,7 +445,7 @@ clutter_value_set_shader_int (GValue *value, /** * clutter_value_set_shader_matrix: * @value: a #GValue - * @size: number of floating point values in @floats + * @size: dimension of the square floating point 2D array in @matrix * @matrix: a matrix of floating point values * * Sets @matrix as the contents of @value. The passed #GValue @@ -459,11 +462,11 @@ clutter_value_set_shader_matrix (GValue *value, gint i; g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value)); - g_return_if_fail (size = 4); shader_matrix = value-data[0].v_pointer; shader_matrix-size = size; + shader_matrix-value = g_new0 (GLfloat, size * size); for (i = 0; i size * size; i++) shader_matrix-value[i] = matrix[i]; -- 1.7.1 From 33f8e79deeb1a90ef11d1998b91c545058837b1b Mon Sep 17 00:00:00 2001 From: Richard Hughes rich...@hughsie.com Date: Wed, 16 Jun 2010 17:46:57 +0100 Subject: [PATCH 2/2] Allow non-square matrix data to be passed to a ClutterShader This allows programs to send large amounts of data as arrays of vectors, rather than the old 4x4 static maximum. This functionality already existed in COGL, but was not exploited by clutter. --- clutter/clutter-shader-types.c | 79 +--- clutter/clutter-shader-types.h |7 clutter/clutter-shader.c |5 ++- 3 files changed, 76 insertions(+), 15 deletions(-) diff --git a/clutter/clutter-shader-types.c b/clutter/clutter-shader-types.c index 57bf11c..f4f131c 100644 --- a/clutter/clutter-shader-types.c +++ b/clutter/clutter-shader-types.c @@ -94,6 +94,7 @@ struct _ClutterShaderInt struct _ClutterShaderMatrix { gint size; + gint length; GLfloat *value; }; @@ -445,18 +446,24 @@ clutter_value_set_shader_int (GValue *value, /** * clutter_value_set_shader_matrix: * @value: a #GValue - * @size: dimension of the square floating point 2D array in @matrix + * @size: dimension of the vector to load, + * e.g. 3 would correspond to a GLSL vec3 + * @length: dimension of 2D array in @matrix, + * to correspond with the number of vectors in the array * @matrix: a matrix of floating point values * * Sets @matrix as the contents of @value. The passed #GValue * must have been initialized using %CLUTTER_TYPE_SHADER_MATRIX. * - * Since: 0.8 + * The number of points in @matrix must be at least @size x @length. + * + * Since: 1.0 */ void -clutter_value_set_shader_matrix (GValue *value, - gint size, - const gfloat *matrix) +clutter_value_set_shader_matrix_full (GValue *value, + gint size, + gint length, + const gfloat *matrix) { ClutterShaderMatrix *shader_matrix; gint i; @@ -466,13 +473,33 @@ clutter_value_set_shader_matrix (GValue *value, shader_matrix = value-data[0].v_pointer; shader_matrix-size = size; - shader_matrix-value = g_new0 (GLfloat, size * size); + shader_matrix-length = length; + shader_matrix-value = g_new0 (GLfloat, size * length); - for (i = 0; i size * size; i++) + for (i = 0; i size * length; i++) shader_matrix-value[i] = matrix[i]; } /** + * clutter_value_set_shader_matrix: + * @value: a #GValue + * @size: dimension of the square floating point 2D array in @matrix + * @matrix: a matrix of floating point values + * + * Sets @matrix as the contents of @value. The passed #GValue + * must have been initialized using %CLUTTER_TYPE_SHADER_MATRIX. + * + * Since: 0.8 + */ +void