Sign in to follow this  
Eric F.

Slower ID3DXSprite:Draw() on non-aligned source rect position/size

Recommended Posts

Eric F.    264

I'm using DirectX 9 and ID3DXSprite to draw my graphics, and I was wondering if using ID3DXSprite:Draw() with a source rect that is not aligned on a specific boundary, or if the source rect has an odd or unaligned width would slow down the rendering.

 

I know this might have been an issue decades ago, but I am wondering is such issues might be lingering in DirectX 9 or on some video cards.

 

I tried to google that stuff, but I couldn't find anything definitive.

 

Thanks for any tips!

Share this post


Link to post
Share on other sites
Brain    18906

I haven't researched this, so take what i say with a pinch of salt, however I would assume this is no longer an issue.

My reasoning for this is that 32 bit colour modes have been standard for quite some time, which ensures every pixel is aligned on a DWORD boundary eliminating the issue.

 

Also, it is the gpu that accesses the graphics ram these days not the cpu directly so I am unsure if the same alignment rules even apply to reads or writes, as these are vector processors dealing in groups of 128 or more bits at once.

 

Let me know if this is useful...

Share this post


Link to post
Share on other sites
MJP    19787

I really doubt that it would cause any issues. All it does is draw your sprite as two triangles, and changing the source rectangle just changes the UV's used for those triangles. So it's not using a weird hardware path, or anything like that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this