Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


- - - - -

memory aligned objects ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 sepul   Members   -  Reputation: 257

Like
0Likes
Like

Posted 14 July 2011 - 04:17 AM

I'm getting exceptions in my SSE code, where the script is trying to do something with Vector3 (which is supposed to be 16-byte aligned)

here is an expample :
__declspec(align(16))  Vec3 ...


in angelcode, vec3 is binded with (asOBJ_VALUE | asOBJ_APP_CLASS_CDAK) flags
engine->RegisterObjectType( "vec3", sizeof(Vec3), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK );

later on, I get exceptions with my math operations that use SSE (xmm loads)

does angelcode support aligned allocation from it's stack ?

dark-hammer engine - http://www.hmrengine.com


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3437

Like
0Likes
Like

Posted 14 July 2011 - 09:20 AM

Not yet. However, you can register the vector3 type as a scoped reference type. This type is treated like a value type in the script, but is allocated on the heap where the application can guarantee the proper memory alignment.

I recommend combining this with memory pooling, so the application won't do a memory allocation for each vector3 instance that is used in the script.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 sepul   Members   -  Reputation: 257

Like
0Likes
Like

Posted 15 July 2011 - 02:49 AM

thanks, I'll do the workaround .
however, do you consider adding this feature for the next release ?

dark-hammer engine - http://www.hmrengine.com


#4 Andreas Jonsson   Moderators   -  Reputation: 3437

Like
0Likes
Like

Posted 15 July 2011 - 09:24 AM

Probably not for the next release, but yes, I plan to add it in the future.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#5 viepr08v10   Members   -  Reputation: 121

Like
0Likes
Like

Posted 01 January 2013 - 03:08 AM

Has this feature of angelscipt been revisited lately, it would be really nice to have right know for a project I'm working on?


Edited by viepr08v10, 01 January 2013 - 03:13 AM.


#6 Andreas Jonsson   Moderators   -  Reputation: 3437

Like
0Likes
Like

Posted 01 January 2013 - 06:15 AM

Not yet. Scoped reference types are still the way to work with types that have specific memory alignment requirements.

 

Regards,

Andreas


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS