Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Creating resources in D3D11 with alignment constraints


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
3 replies to this topic

#1 joystick-hero   Members   -  Reputation: 148

Like
0Likes
Like

Posted 08 August 2014 - 03:48 PM

This might be a newbie question but I was wondering if there's a way or some kind of convention regarding resource's allocation alignment in memory.

 

For instance, when I create a new texture2d via ID3D11Device::CreateTexture2D method with a DXGI_FORMAT_R32G32B32A32_FLOAT format, how can I tell directx that I want the resource to have a X-byte alignment?

 

I'm interested in this because when and if I need to read the texture2d in a compute shader, in order to do it the most efficient way possible (when memory coalescing works), the starting address of the resource must be a multiple of the region size I'm reading. According to page number 9 of this pdf slide



Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 5643

Like
2Likes
Like

Posted 09 August 2014 - 06:22 AM

There is no way to do this through the Direct3D 11 API - the actual memory location and alignment of the resource is up to the driver / runtime to determine, and you don't have access to it directly.  I assume that slide is talking about the use of CUDA, rather than D3D11.

 

This is likely to change with Direct3D 12, which is supposed to give you significantly more robust control over the memory resources used by the API.



#3 Hodgman   Moderators   -  Reputation: 33367

Like
3Likes
Like

Posted 09 August 2014 - 08:25 AM

FWIW, I would expect current drivers to allocate all textures using at least 256 byte alignment wink.png



#4 joystick-hero   Members   -  Reputation: 148

Like
0Likes
Like

Posted 09 August 2014 - 04:45 PM

I guess.. that's a relief pals haha. Thank you for your answers.






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